File tree Expand file tree Collapse file tree 5 files changed +44
-4
lines changed
Expand file tree Collapse file tree 5 files changed +44
-4
lines changed Original file line number Diff line number Diff line change 99 runs-on : ubuntu-latest
1010 strategy :
1111 matrix :
12- php-versions : ['8.3 ']
12+ php-versions : ['8.1', '8.4 ']
1313 steps :
1414 - name : Checkout
1515 uses : actions/checkout@v2
@@ -115,3 +115,33 @@ jobs:
115115 rm -rf composer.lock
116116 composer install
117117 vendor/bin/phpunit plugins/${{matrix.plugin}}
118+
119+ #
120+ # CakePHP version compatability
121+ #
122+ cakephp_version_compatibility :
123+ name : CakePHP ${{ matrix.version }} Test
124+ runs-on : ubuntu-latest
125+ strategy :
126+ matrix :
127+ version : ['~5.0', '~5.1']
128+ steps :
129+ - name : Checkout
130+ uses : actions/checkout@v2
131+
132+ - name : Setup PHP
133+ uses : shivammathur/setup-php@v2
134+ with :
135+ php-version : ' 8.1'
136+ extensions : mbstring, intl
137+
138+ - name : PHP Version
139+ run : php -v
140+
141+ - name : CakePHP ${{matrix.version}} Compatability
142+ run : |
143+ composer self-update
144+ rm -rf composer.lock
145+ composer require cakephp/cakephp:${{matrix.version}} --no-update
146+ composer install --prefer-dist --no-progress
147+ composer test
Original file line number Diff line number Diff line change 108108 * Duration will be set to '+2 minutes' in bootstrap.php when debug = true
109109 * If you set 'className' => 'Null' core cache will be disabled.
110110 */
111- '_cake_core_ ' => [
111+ '_cake_translations_ ' => [
112112 'className ' => FileEngine::class,
113113 'prefix ' => 'myapp_cake_core_ ' ,
114114 'path ' => CACHE . 'persistent ' . DS ,
Original file line number Diff line number Diff line change @@ -3,5 +3,6 @@ parameters:
33 checkGenericClassInNonGenericObjectType : false
44 checkMissingIterableValueType : false
55 treatPhpDocTypesAsCertain : false
6+ reportUnmatchedIgnoredErrors : false
67 excludePaths :
78 - plugins/exception-render/src/OpenApiExceptionSchema.php
Original file line number Diff line number Diff line change @@ -117,7 +117,11 @@ private function recursion(mixed &$mixed): mixed
117117 private function collection (mixed $ collection ): array
118118 {
119119 try {
120- $ entity = $ collection ->first ();
120+ if ($ collection instanceof PaginatedResultSet) {
121+ $ entity = $ collection ->toArray ()[0 ];
122+ } else {
123+ $ entity = $ collection ->first ();
124+ }
121125 $ tableName = Inflector::tableize ((new ReflectionClass ($ entity ))->getShortName ());
122126 } catch (ReflectionException $ e ) {
123127 $ tableName = 'data ' ;
Original file line number Diff line number Diff line change @@ -138,7 +138,12 @@ private function collection(mixed $jsonLd): array
138138 $ return = [];
139139
140140 try {
141- $ entity = $ jsonLd ->first ();
141+ if ($ jsonLd instanceof PaginatedResultSet) {
142+ $ entity = $ jsonLd ->toArray ()[0 ];
143+ } else {
144+ $ entity = $ jsonLd ->first ();
145+ }
146+
142147 if ($ entity instanceof JsonLdDataInterface) {
143148 $ return ['@context ' ] = $ entity ->getJsonLdContext ();
144149 }
You can’t perform that action at this time.
0 commit comments