Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Sort an array in ascending order
<?php sort(array &$array, int $flags = SORT_REGULAR): true
<?php parent::__construct($reason, $reasonData);
sort($literals);
$this->literals = $literals;
}
<?php }
sort($literals);
$this->literals = $literals;
}
<?php {
$this->rules = $rules;
$this->types = array_keys($rules);
sort($this->types);
$this->rewind();
}
<?php $data = $this->dumpValues($package, $keys, $data);
if (isset($data['keywords']) && \is_array($data['keywords'])) {
sort($data['keywords']);
}
if ($package->isAbandoned()) {
<?php }
}
sort($data['dev-package-names']);
usort($data['packages'], function ($a, $b) {
return strcmp($a['name'], $b['name']);
});
<?php $packagesInfo[] = $package->getName() . '@' . $package->getVersion() . ($package instanceof AliasPackage ? ' (alias of '.$package->getAliasOf()->getVersion().')' : '');
}
sort($packagesInfo);
return $packagesInfo;
}
<?php }
}
sort($files);
return $files;
}
<?php $this->fail('Expected exception to be thrown');
} catch (InvalidPackageException $e) {
$errors = $e->getErrors();
sort($expectedErrors);
sort($errors);
$this->assertEquals($expectedErrors, $errors);
}
<?php } catch (InvalidPackageException $e) {
$errors = $e->getErrors();
sort($expectedErrors);
sort($errors);
$this->assertEquals($expectedErrors, $errors);
}
}
<?php $loader->load($config);
$warnings = $loader->getWarnings();
sort($expectedWarnings);
sort($warnings);
$this->assertEquals($expectedWarnings, $warnings);
}
<?php $loader->load($config);
$warnings = $loader->getWarnings();
sort($expectedWarnings);
sort($warnings);
$this->assertEquals($expectedWarnings, $warnings);
}
<?php return "{$package->getPrettyName()}-{$package->getPrettyVersion()}";
}, $repo->getPackages());
sort($expectedPackages);
sort($foundPackages);
$this->assertSame($expectedPackages, $foundPackages);
<?php }, $repo->getPackages());
sort($expectedPackages);
sort($foundPackages);
$this->assertSame($expectedPackages, $foundPackages);
<?php $package = $packages[1];
$names[] = $package->getName();
sort($names);
$this->assertEquals(array('test/path-unversioned', 'test/path-versioned'), $names);
}