|
38 | 38 |
|
39 | 39 | # Add ReturnTypeWillChange attribute to PHP 8-incompatible methods. |
40 | 40 | declare -r -a REQUESTS_V1_METHODS=( |
41 | | - 'Requests_Utility_FilteredIterator::unserialize' |
42 | | - 'Requests_Utility_FilteredIterator::__unserialize' |
43 | | - 'Requests_Utility_FilteredIterator::current' |
44 | | - 'Requests_Cookie_Jar::offsetExists' |
45 | | - 'Requests_Cookie_Jar::offsetGet' |
46 | | - 'Requests_Cookie_Jar::offsetSet' |
47 | | - 'Requests_Cookie_Jar::offsetUnset' |
48 | | - 'Requests_Cookie_Jar::getIterator' |
49 | | - 'Requests_Utility_CaseInsensitiveDictionary::offsetExists' |
50 | | - 'Requests_Utility_CaseInsensitiveDictionary::offsetGet' |
51 | | - 'Requests_Utility_CaseInsensitiveDictionary::offsetSet' |
52 | | - 'Requests_Utility_CaseInsensitiveDictionary::offsetUnset' |
53 | | - 'Requests_Utility_CaseInsensitiveDictionary::getIterator' |
| 41 | + "Requests_Cookie_Jar::getIterator" |
| 42 | + "Requests_Cookie_Jar::offsetExists" |
| 43 | + "Requests_Cookie_Jar::offsetGet" |
| 44 | + "Requests_Cookie_Jar::offsetSet" |
| 45 | + "Requests_Cookie_Jar::offsetUnset" |
| 46 | + "Requests_Utility_CaseInsensitiveDictionary::getIterator" |
| 47 | + "Requests_Utility_CaseInsensitiveDictionary::offsetExists" |
| 48 | + "Requests_Utility_CaseInsensitiveDictionary::offsetGet" |
| 49 | + "Requests_Utility_CaseInsensitiveDictionary::offsetSet" |
| 50 | + "Requests_Utility_CaseInsensitiveDictionary::offsetUnset" |
| 51 | + "Requests_Utility_FilteredIterator::current" |
| 52 | + "Requests_Utility_FilteredIterator::__unserialize" |
| 53 | + "Requests_Utility_FilteredIterator::unserialize" |
54 | 54 | ) |
55 | 55 | for METHOD in "${REQUESTS_V1_METHODS[@]}"; do |
56 | 56 | # Get the line number where the method is defined. |
57 | 57 | LINE="$(php -r "require 'wordpress-stubs.php'; print (new ReflectionMethod('${METHOD}'))->getStartLine();")" |
| 58 | + if [ -z "${LINE}" ]; then |
| 59 | + continue |
| 60 | + fi |
58 | 61 | echo "${METHOD} is defined on line ${LINE}." |
59 | 62 |
|
60 | 63 | # Check the previous line forr ReturnTypeWillChange attribute. |
|
0 commit comments