Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
245cb65
Fix for issue #35. Corrected ActiveRecordTest's so that capitalizatio…
ipundit Aug 31, 2023
e1bb78f
Primary key has to be lowercased too because gettter/setters are lowe…
ipundit Aug 31, 2023
f6e2981
Fix for issue #35. Corrected ActiveRecordTest's so that capitalizatio…
ipundit Aug 31, 2023
67471f5
Primary key has to be lowercased too because gettter/setters are lowe…
ipundit Aug 31, 2023
83a4db0
Merge branch 'master' of https://github.com/ipundit/activerecord
ipundit Sep 1, 2023
1aea4e1
Merge branch 'master' into master
ipundit Sep 1, 2023
9639f31
Merge branch 'master' of https://github.com/php-activerecord/activere…
ipundit Sep 2, 2023
52478ab
Running all the tests may take more than the default of 300 seconds. …
ipundit Sep 2, 2023
c323677
Write proper tests that demonstrate the fix for issue #35:
ipundit Sep 2, 2023
80ed052
Switched from firstName field to existing mixedCaseField to pass Post…
ipundit Sep 2, 2023
b8ecfc0
- List things in alphabetical order
ipundit Sep 2, 2023
23d00a7
Revert updates to test suite as ActiveRecordTest::test_case_insensiti…
ipundit Sep 2, 2023
e31ec4f
Merge branch 'master' of https://github.com/php-activerecord/activere…
ipundit Sep 2, 2023
9a6fb32
Merge branch 'master' of https://github.com/php-activerecord/activere…
ipundit Sep 2, 2023
b3e88d4
- Refactored find() and clarified its documentation for return values.
ipundit Sep 3, 2023
8a8bdb0
Sorted into alphabetical order. Added /node_modules/ and package-lock…
ipundit Sep 3, 2023
c498b3c
Fix to conform to project style guide
ipundit Sep 3, 2023
c29d601
Revert back to narrower static from Model
ipundit Sep 3, 2023
51f9cae
Replaced with GitHub Actions
ipundit Sep 3, 2023
8e5c19f
Added test directory to .php-cs-fixer.php and then updated all the te…
ipundit Sep 3, 2023
f0c85de
Bug fix to pass regression after running composer style-fix
ipundit Sep 3, 2023
0f7ce64
Ignore Visual Studio Code configuration file
ipundit Sep 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
.project
.idea
.buildpath
.settings
*.log
*.db
*.log
*.swp
.phpunit.cache
vendor/*
output/*
composer.lock
phpunit.xml
.buildpath
.idea
.php_cs.cache
.php_cs
docs/api
.php-cs-fixer.cache
.phpunit.cache
.phpunit.result.cache
.project
.settings
.stan-cache
.php-cs-fixer.cache
/.vscode
/docs/api
/node_modules/*
/output/*
/vendor/*
composer.lock
package-lock.json
phpunit.xml
11 changes: 10 additions & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@

$finder = new PhpCsFixer\Finder();
$config = new PhpCsFixer\Config('json-schema', 'json-schema style guide');
$finder->in(__DIR__ . '/lib');
$finder->in(__DIR__)
->exclude('.github')
->exclude('.phpunit.cache')
->exclude('.stan.cache')
->exclude('.vscode')
->exclude('assets')
->exclude('docs')
->exclude('node_modules')
->exclude('output')
->exclude('vendor');

$config
->setRules([
Expand Down
54 changes: 0 additions & 54 deletions .travis.yml

This file was deleted.

14 changes: 7 additions & 7 deletions lib/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,7 @@ public static function last(/* ... */)
* YourModel::find(1,2,3);
*
* # finding by pk accepts an options array
* YourModel::find(123,array('order' => 'name desc'));
* YourModel::find(123, ['order' => 'name desc']);
* ```
*
* Finding by using a conditions array:
Expand Down Expand Up @@ -1719,19 +1719,19 @@ public static function last(/* ... */)
* array<string, int|string> static User::find(["name"=>"Philip"]);
* "first" static|null User::find("first", ["name"=>"Waldo"]);
* "last" static|null User::find("last", ["name"=>"William"]);
* "all" static[] User::find("all", ["name" => "Stephen"]
* "all" static[] User::find("all", ["name"=>"Stephen"]
* ...int|string static[] User::find(1, 3, 5, 8);
* array<int,int|string> static[] User::find([1,3,5,8]);
* array<"conditions", array<string,string>> static[] User::find(["conditions"=> ["name" => "Kurt"]]);
* array<"conditions", array<string, string>> static[] User::find(["conditions"=>["name"=>"Kurt"]]);
*/
public static function find(/* $type, $options */)
public static function find(/* $type, $options */): static|array|null
{
$class = get_called_class();

if (func_num_args() <= 0) {
$args = func_get_args();
if (0 === count($args)) {
throw new RecordNotFound("Couldn't find $class without an ID");
}
$args = func_get_args();
$options = static::extract_and_validate_options($args);

$num_args = count($args);
Expand Down Expand Up @@ -1765,7 +1765,7 @@ public static function find(/* $type, $options */)

// find by pk
else {
if (1 === count($args) && 1 == $num_args) {
if (1 === $num_args) {
$args = $args[0];
}

Expand Down
6 changes: 3 additions & 3 deletions test/ActiveRecordCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ public function tearDown(): void
Cache::initialize();
}

public function test_default_expire()
public function testDefaultExpire()
{
$this->assertEquals(30, Cache::$options['expire']);
}

public function test_explicit_default_expire()
public function testExplicitDefaultExpire()
{
Config::instance()->set_cache('memcache://localhost', ['expire' => 1]);
$this->assertEquals(1, Cache::$options['expire']);
}

public function test_caches_column_meta_data()
public function testCachesColumnMetaData()
{
Author::first();

Expand Down
Loading