Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
sjlehn committed Nov 8, 2023
2 parents 743d52f + b7dbc3c commit 556305a
Show file tree
Hide file tree
Showing 289 changed files with 21,203 additions and 6,242 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
name: Run tests against php ${{matrix.php}}
steps:
- name: Checkout
Expand All @@ -20,31 +20,34 @@ jobs:
PHP_VERSION: ${{matrix.php}}

- name: Composer Install
run: docker-compose -f docker-compose.yml run -e PHP_VERSION=${{matrix.php}} test_runner composer update -d /opt/project/phpstorm-stubs
run: docker-compose -f docker-compose.yml run -e PHP_VERSION=${{matrix.php}} test_runner composer install
env:
PHP_VERSION: ${{matrix.php}}

- name: Dump Reflection To File
run: docker-compose -f docker-compose.yml run -e PHP_VERSION=${{matrix.php}} php_under_test /usr/local/bin/php /opt/project/phpstorm-stubs/tests/Tools/dump-reflection-to-file.php ReflectionData.json
run: docker-compose -f docker-compose.yml run -e PHP_VERSION=${{matrix.php}} php_under_test /usr/local/bin/php tests/Tools/dump-reflection-to-file.php ReflectionData.json
env:
PHP_VERSION: ${{matrix.php}}

- name: Run Tests
run: docker-compose -f docker-compose.yml run -e PHP_VERSION=${{matrix.php}} test_runner /opt/project/phpstorm-stubs/vendor/bin/phpunit --configuration /opt/project/phpstorm-stubs/phpunit.xml --testsuite PHP_${{matrix.php}}
run: docker-compose -f docker-compose.yml run -e PHP_VERSION=${{matrix.php}} test_runner vendor/bin/phpunit --testsuite PHP_${{matrix.php}}
env:
PHP_VERSION: ${{matrix.php}}
additional:
runs-on: ubuntu-latest
name: Run checks for StubsMap and cs-fixer
name: Run cs-fixer and stubs structure tests
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Composer Install
run: docker-compose -f docker-compose.yml run test_runner composer install -d /opt/project/phpstorm-stubs
run: docker-compose -f docker-compose.yml run test_runner composer install

- name: Test Stubs Map
run: ./tests/Tools/check-stub-map
- name: Test PhpDoc
run: docker-compose -f docker-compose.yml run test_runner vendor/bin/phpunit --testsuite PhpDoc

- name: Test Stubs Map, Structure and Reflection
run: docker-compose -f docker-compose.yml run test_runner vendor/bin/phpunit --testsuite Structure

- name: run cs fixer
run: docker-compose -f docker-compose.yml run test_runner composer cs -d /opt/project/phpstorm-stubs
run: docker-compose -f docker-compose.yml run -e PHP_CS_FIXER_IGNORE_ENV=true test_runner composer cs
4 changes: 2 additions & 2 deletions .github/workflows/testLinks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@v2

- name: Composer Install
run: docker-compose -f docker-compose.yml run test_runner composer install -d /opt/project/phpstorm-stubs
run: docker-compose -f docker-compose.yml run test_runner composer install
env:
PHP_VERSION: '8.0'

Expand All @@ -23,6 +23,6 @@ jobs:
PHP_VERSION: '8.0'

- name: Run Tests
run: docker-compose -f docker-compose.yml run -e CHECK_LINKS=true test_runner /opt/project/phpstorm-stubs/vendor/bin/phpunit --configuration /opt/project/phpstorm-stubs/phpunit.xml --testsuite PhpDoc
run: docker-compose -f docker-compose.yml run -e CHECK_LINKS=true test_runner vendor/bin/phpunit --testsuite PhpDoc
env:
PHP_VERSION: '8.0'
10 changes: 5 additions & 5 deletions .github/workflows/testPeclExtensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ jobs:
PHP_VERSION: '8.0'

- name: Composer Install
run: docker-compose -f docker-compose.yml run test_runner composer install -d /opt/project/phpstorm-stubs
run: docker-compose -f docker-compose.yml run test_runner composer install

- name: Dump Reflection With Pecl To File
run: docker-compose -f docker-compose.yml run pecl_extensions /usr/local/bin/php /opt/project/phpstorm-stubs/tests/Tools/dump-reflection-to-file.php ReflectionDataPecl.json
run: docker-compose -f docker-compose.yml run pecl_extensions /usr/local/bin/php tests/Tools/dump-reflection-to-file.php ReflectionDataPecl.json

- name: Dump Reflection Without Pecl To File
run: docker-compose -f docker-compose.yml run php_under_test /usr/local/bin/php /opt/project/phpstorm-stubs/tests/Tools/dump-reflection-to-file.php ReflectionData.json
run: docker-compose -f docker-compose.yml run php_under_test /usr/local/bin/php tests/Tools/dump-reflection-to-file.php ReflectionData.json

- name: Build Reflection Data With Pecl Only
run: docker-compose -f docker-compose.yml run php_under_test /usr/local/bin/php /opt/project/phpstorm-stubs/tests/Tools/dump-pecl-to-file.php
run: docker-compose -f docker-compose.yml run php_under_test /usr/local/bin/php tests/Tools/dump-pecl-to-file.php

- name: Run Tests
run: docker-compose -f docker-compose.yml run -e PHP_VERSION='8.0' test_runner /opt/project/phpstorm-stubs/vendor/bin/phpunit /opt/project/phpstorm-stubs/tests/
run: docker-compose -f docker-compose.yml run -e PHP_VERSION='8.0' test_runner vendor/bin/phpunit tests/
env:
PHP_VERSION: '8.0'
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ rest-client.private.env.json
.idea/workspace.xml
.idea/shelf

# PHPUnit
phpunit.xml

# Composer
vendor
composer.lock

.php_cs.cache
.phpunit.result.cache
Expand Down
3 changes: 3 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

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

34 changes: 34 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
### Code of Conduct

This code of conduct outlines our expectations for all those who participate in our open source projects and communities (community programs), as well as the consequences for unacceptable behaviour. We invite all those who participate to help us create safe and positive experiences for everyone. Communities mirror the societies in which they exist and positive action is essential to counteract the many forms of inequality and abuses of power that exist in society.

#### How to behave
The following behaviours are expected and requested of all community members:

* Participate in an authentic and active way. In doing so, you contribute to the health and longevity of this community.
* Exercise consideration, respect and empathy in your speech and actions. Remember, we have all been through different stages of learning when adopting technologies.
* Refrain from demeaning, discriminatory, or harassing behaviour and speech.
* Disagreements on things are fine, argumentative behaviour or trolling are not.

#### How not to behave

* Do not perform threats of violence or use violent language directed against another person.
* Do not make jokes of sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory nature, or use language of this nature.
* Do not post or display sexually explicit or violent material.
* Do not post or threaten to post other people’s personally identifying information ("doxing").
* Do not make personal insults, particularly those related to gender, sexual orientation, race, religion, or disability.
* Do not engage in sexual attention. This includes, sexualised comments or jokes and sexual advances.
* Do not advocate for, or encourage, any of the above behaviour.

Please take into account that online communities bring together people from many different cultures and backgrounds. It's important to understand that sometimes the combination of cultural differences and online interaction can lead to misunderstandings. That is why having empathy is very important.

#### How to report issues

If someone is acting inappropriately or violating this Code of Conduct in any shape or form, and they are not receptive to your feedback or you prefer not to confront them, please reach out to JetBrains via codeofconduct@jetbrains.com

#### Consequences of Unacceptable Behaviour

Unacceptable behaviour from any community member will not be tolerated. Anyone asked to stop unacceptable behaviour is expected to comply immediately. If a community member engages in unacceptable behaviour, JetBrains and/or community organisers may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from the community without warning.

##### License and attribution
The license is based off of The Citizen Code of Conduct is distributed by Stumptown Syndicate under a Creative Commons Attribution-ShareAlike license.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Please check our [issue tracker] for issues corresponding to the problem you're
* Please avoid any unnecessary changes e.g., spacing, line endings, HTML formatting. Remember, these files are NOT for human consumption. We want to preserve meaningful history.
* Please try to match existing style for any particular file - formatting, spacing, naming conventions.
* Please add corresponding @since tags
* Please run `docker-compose -f docker-compose.yml run test_runner composer cs -d /opt/project/phpstorm-stubs` to check the code style and `docker-compose -f docker-compose.yml run test_runner composer cs-fix -d /opt/project/phpstorm-stubs` to fix it
* Please run `docker-compose -f docker-compose.yml run test_runner composer cs` to check the code style and `docker-compose -f docker-compose.yml run test_runner composer cs-fix` to fix it

## Typehints In Signature
* Please ensure that typehints in signature match types returned by reflection. If reflection doesn't return any type please add such typehints via PhpDoc
Expand Down
21 changes: 18 additions & 3 deletions Core/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function func_get_args(): array {}
* @param string $string <p>
* The string being measured for length.
* </p>
* @return int The length of the <i>string</i> on success,
* @return int<0,max> The length of the <i>string</i> on success,
* and 0 if the <i>string</i> is empty.
*/
#[Pure]
Expand Down Expand Up @@ -166,6 +166,16 @@ function str_ends_with(string $haystack, string $needle): bool {}
#[Pure]
function str_contains(string $haystack, string $needle): bool {}

/**
* @since 8.3
*/
function str_decrement(string $string): string {}

/**
* @since 8.3
*/
function str_increment(string $string): string {}

/**
* Return the current key and value pair from an array and advance the array cursor
* @link https://php.net/manual/en/function.each.php
Expand Down Expand Up @@ -341,7 +351,7 @@ function error_reporting(?int $error_level): int {}
function define(
string $constant_name,
#[LanguageLevelTypeAware(['8.1' => 'mixed'], default: 'null|array|bool|int|float|string')] $value,
#[Deprecated()] bool $case_insensitive = false
#[Deprecated(since: "7.3")] bool $case_insensitive = false
): bool {}

/**
Expand Down Expand Up @@ -678,6 +688,7 @@ function set_error_handler(?callable $callback, int $error_levels = E_ALL|E_STRI
* @link https://php.net/manual/en/function.restore-error-handler.php
* @return bool This function always returns true.
*/
#[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')]
function restore_error_handler(): bool {}

/**
Expand All @@ -701,6 +712,7 @@ function set_exception_handler(?callable $callback) {}
* @link https://php.net/manual/en/function.restore-exception-handler.php
* @return bool This function always returns true.
*/
#[LanguageLevelTypeAware(['8.2' => 'true'], default: 'bool')]
function restore_exception_handler(): bool {}

/**
Expand Down Expand Up @@ -1027,7 +1039,10 @@ function debug_backtrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT, int $lim
* </p>
* @return void
*/
function debug_print_backtrace(int $options = 0, int $limit = 0): void {}
function debug_print_backtrace(
int $options = 0,
#[PhpStormStubsElementAvailable(from: '7.0')] int $limit = 0
): void {}

/**
* Forces collection of any existing garbage cycles
Expand Down
Loading

0 comments on commit 556305a

Please sign in to comment.