From 41e812cefcc1eee3b07970da00010e158f334385 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Tue, 13 Apr 2021 09:12:24 +0100 Subject: [PATCH 1/4] #914 - Add test case --- stub/issue914.zep | 9 +++++++++ tests/Extension/Issue914Test.php | 27 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 stub/issue914.zep create mode 100644 tests/Extension/Issue914Test.php diff --git a/stub/issue914.zep b/stub/issue914.zep new file mode 100644 index 000000000..09e410ce1 --- /dev/null +++ b/stub/issue914.zep @@ -0,0 +1,9 @@ +namespace Stub; + +class Issue914 extends \mysqli +{ + public function __construct() + { + parent::__construct(); + } +} diff --git a/tests/Extension/Issue914Test.php b/tests/Extension/Issue914Test.php new file mode 100644 index 000000000..43fbc4691 --- /dev/null +++ b/tests/Extension/Issue914Test.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Extension; + +use PHPUnit\Framework\TestCase; +use Stub\Issue914; + +final class Issue914Test extends TestCase +{ + public function testIssue914(): void + { + $test = new Issue914(); + + $this->assertInstanceOf(\mysqli::class, $test); + } +} From ac77d2f0e7c53e288945a7bd128e493dc6b35ba7 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Tue, 13 Apr 2021 09:12:51 +0100 Subject: [PATCH 2/4] #914 - Add installation of 'mysqli' inside Dockerfiles --- docker-compose.yml | 5 ----- docker/7.4/Dockerfile | 2 +- docker/8.0/Dockerfile | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 85923e0fa..8e766f302 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,5 @@ # For local development only. -# First development steps after start containers: -# - .ci/install-zephir-parser.sh -# - php zephir stubs -# - cd ext/ && ./install - version: '3' services: diff --git a/docker/7.4/Dockerfile b/docker/7.4/Dockerfile index 5de4f9e83..6dd0d38a9 100644 --- a/docker/7.4/Dockerfile +++ b/docker/7.4/Dockerfile @@ -15,7 +15,7 @@ RUN apt update -y && apt install -y \ libzip-dev && \ pecl install psr -RUN docker-php-ext-install zip gmp intl && \ +RUN docker-php-ext-install zip gmp intl mysqli && \ docker-php-ext-enable psr # Install Zephir parser diff --git a/docker/8.0/Dockerfile b/docker/8.0/Dockerfile index 7e33039b8..e96b89880 100644 --- a/docker/8.0/Dockerfile +++ b/docker/8.0/Dockerfile @@ -15,7 +15,7 @@ RUN apt update -y && apt install -y \ libzip-dev && \ pecl install psr -RUN docker-php-ext-install zip gmp intl && \ +RUN docker-php-ext-install zip gmp intl mysqli && \ docker-php-ext-enable psr # Install Zephir parser From d0b1214639f8006da7db6205797e3395c42b66f3 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Tue, 13 Apr 2021 09:24:45 +0100 Subject: [PATCH 3/4] #914 - Add installation of 'mysqli' Win CI --- .github/workflows/build-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 30bbfb124..3cfc84433 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -51,7 +51,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: mbstring, fileinfo, gmp, sqlite, pdo_sqlite, psr, zip + extensions: mbstring, fileinfo, gmp, sqlite, pdo_sqlite, psr, zip, mysqli coverage: none # variables_order: https://github.com/zephir-lang/zephir/pull/1537 # enable_dl: https://github.com/zephir-lang/zephir/pull/1654 From 403629b5dd4b2166753239bdb857ee86c9b2bdef Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Tue, 13 Apr 2021 09:29:45 +0100 Subject: [PATCH 4/4] #914 - Add TODO --- Library/StaticCall.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Library/StaticCall.php b/Library/StaticCall.php index 21d1fe67c..a07db26a6 100644 --- a/Library/StaticCall.php +++ b/Library/StaticCall.php @@ -78,7 +78,7 @@ public function compile(Expression $expr, CompilationContext $compilationContext } } - /* + /** * Include fcall header */ $compilationContext->headersManager->add('kernel/fcall'); @@ -127,10 +127,11 @@ public function compile(Expression $expr, CompilationContext $compilationContext } } - /* + /** * Check if the class implements the method */ if (!$dynamicMethod && !$dynamicClass) { + // TODO: Consider to check instance of ClassDefinitionRuntime and throw another error, telling that class was not found. if (!$classDefinition->hasMethod($methodName)) { $possibleMethod = $classDefinition->getPossibleMethodName($methodName); if ($possibleMethod) { @@ -153,7 +154,7 @@ public function compile(Expression $expr, CompilationContext $compilationContext if (!$classDefinition->hasMethod('__callStatic')) { if ($method instanceof ClassMethod && !$method->isBundled()) { - /* + /** * Try to produce an exception if method is called with a wrong number of parameters */ if (isset($expression['parameters'])) {