Skip to content

Commit

Permalink
feat: support foreign object memoization
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyBogdanov committed Nov 16, 2022
1 parent 5e39a63 commit b94f8b8
Show file tree
Hide file tree
Showing 18 changed files with 259 additions and 127 deletions.
1 change: 1 addition & 0 deletions .idea/memoize.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/php-test-framework.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 76 additions & 1 deletion .idea/php.xml
100755 → 100644

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/phpunit.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/remote-mappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 30 additions & 25 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
{
"name": "tonybogdanov/memoize",
"description": "Object & class-level in-memory caching",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Tony Bogdanov",
"email": "[email protected]"
}
],
"require": {
"php-64bit": "^7.4|^8.1"
},
"autoload": {
"psr-4": {
"TonyBogdanov\\Memoize\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"TonyBogdanov\\Memoize\\Tests\\": "tests/"
}
},
"require-dev": {
"phpunit/phpunit": "^9.5"
"name": "tonybogdanov/memoize",
"description": "Object & class-level in-memory caching",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Tony Bogdanov",
"email": "[email protected]"
}
],
"require": {
"php-64bit": "^7.4|^8.1"
},
"config": {
"platform": {
"php": "8.1"
}
},
"autoload": {
"psr-4": {
"TonyBogdanov\\Memoize\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"TonyBogdanov\\Memoize\\Tests\\": "tests/"
}
},
"require-dev": {
"phpunit/phpunit": "^9.5"
}
}
43 changes: 23 additions & 20 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
cacheResultFile=".phpunit.cache/test-results"
executionOrder="depends,defects"
forceCoversAnnotation="false"
beStrictAboutCoversAnnotation="false"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
Expand Down
11 changes: 9 additions & 2 deletions src/Exceptions/UnknownOwnerException.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@ class UnknownOwnerException extends RuntimeException {
* @param $owner
*/
public function __construct( $owner ) {
parent::__construct( sprintf( 'Unknown owner reference: %1$s.', is_object( $owner ) ?
get_class( $owner ) : ( is_array( $owner ) ? '(array) ...' : var_export( $owner, true ) ) ) );
if ( is_object( $owner ) ) {
$owner = get_class( $owner );
} else if ( is_array( $owner ) ) {
$owner = '(array) ...';
} else {
$owner = var_export( $owner, true );
}

parent::__construct( sprintf( 'Unknown owner reference: %1$s.', $owner ) );
}

}
Loading

0 comments on commit b94f8b8

Please sign in to comment.