Skip to content

Commit

Permalink
Dropped support for inaccessible array values in PHP 7.1 or older.
Browse files Browse the repository at this point in the history
  • Loading branch information
guelzow committed Dec 27, 2024
1 parent 289dc07 commit f92da98
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Analyse/Callback/Iterate/ThroughArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ public function callMe(): string
* @param array $array
* The array we are analysing.
* @param int|string $key
* A current key that we check if the value in that array is actually
* accessible. And yes, inaccessible array values do exist.
* A current key.
* @param mixed $value
* The value of that key that we are analysing
* @param string $multilineCodeGen
Expand All @@ -118,12 +117,6 @@ protected function prepareModel(array $array, $key, $value, string $multilineCod
->setData($value)
->setCodeGenType($multilineCodeGen);

if (!array_key_exists($key, $array)) {
// Looks like we have an inaccessible array value here.
$model->setCodeGenType(static::CODEGEN_TYPE_ARRAY_VALUES_ACCESS)
->setConnectorParameters(array_search($key, array_keys($array)));
}

if (is_string($key)) {
$model->setName($this->pool->encodingService->encodeString($key))
->setConnectorType(static::CONNECTOR_ASSOCIATIVE_ARRAY);
Expand Down

0 comments on commit f92da98

Please sign in to comment.