Skip to content

Commit

Permalink
Merge pull request #78 from weierophinney/feature/fix-lockfile
Browse files Browse the repository at this point in the history
Ensure lockfile is created using PHP 7.3
  • Loading branch information
weierophinney authored Jan 13, 2022
2 parents 478fa13 + dbd5a72 commit 98513d4
Show file tree
Hide file tree
Showing 21 changed files with 1,026 additions and 999 deletions.
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
"forum": "https://discourse.laminas.dev"
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"composer/package-versions-deprecated": true
}
},
"extra": {
"laminas": {
Expand Down
1,617 changes: 870 additions & 747 deletions composer.lock

Large diffs are not rendered by default.

352 changes: 123 additions & 229 deletions psalm-baseline.xml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/Controller/AbstractConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ abstract public function getConfig();
/** @return array|ApiProblemResponse */
public function processAction()
{
/** @var Request $request */
$request = $this->getRequest();
$headers = $request->getHeaders();
$accept = $this->getHeaderType($headers, 'accept');
Expand Down
2 changes: 2 additions & 0 deletions src/Controller/AbstractPluginManagerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Laminas\ApiTools\ApiProblem\ApiProblem;
use Laminas\ApiTools\ApiProblem\ApiProblemResponse;
use Laminas\Http\Request;
use Laminas\Mvc\Controller\AbstractActionController;
use Laminas\View\Model\JsonModel;

Expand All @@ -24,6 +25,7 @@ abstract class AbstractPluginManagerController extends AbstractActionController
*/
public function handleRequest()
{
/** @var Request $request */
$request = $this->getRequest();

if ($request->getMethod() !== $request::METHOD_GET) {
Expand Down
2 changes: 2 additions & 0 deletions src/Controller/AuthenticationTypeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Laminas\ApiTools\ApiProblem\ApiProblemResponse;
use Laminas\ApiTools\ContentNegotiation\ViewModel;
use Laminas\ApiTools\MvcAuth\Authentication\DefaultAuthenticationListener as AuthListener;
use Laminas\Http\Request;

class AuthenticationTypeController extends AbstractAuthenticationController
{
Expand All @@ -27,6 +28,7 @@ public function __construct(AuthListener $authListener)
*/
public function authTypeAction()
{
/** @var Request $request */
$request = $this->getRequest();
$version = $this->getVersion($request);

Expand Down
6 changes: 4 additions & 2 deletions src/Controller/AuthorizationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
use Laminas\ApiTools\ContentNegotiation\ViewModel;
use Laminas\ApiTools\Hal\Entity;
use Laminas\ApiTools\Hal\Link\Link;
use Laminas\Http\Request;
use Laminas\Mvc\Controller\AbstractActionController;
use Laminas\Mvc\MvcEvent;
use Laminas\Stdlib\RequestInterface as Request;
use Laminas\Stdlib\RequestInterface;
use RuntimeException;

use function sprintf;
Expand All @@ -37,6 +38,7 @@ public function __construct(AuthorizationModelFactory $factory)
/** @return ViewModel|ApiProblemResponse */
public function authorizationAction()
{
/** @var Request $request */
$request = $this->getRequest();
$version = $request->getQuery('version', 1);
$model = $this->getModel();
Expand Down Expand Up @@ -130,7 +132,7 @@ public function getModuleName()
*
* @return $this
*/
public function setRequest(Request $request)
public function setRequest(RequestInterface $request)
{
$this->request = $request;
return $this;
Expand Down
4 changes: 3 additions & 1 deletion src/Controller/InputFilterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ public function indexAction()
$event = $this->getEvent();
$routeMatch = $event->getRouteMatch();
$route = $this->deriveRouteName($routeMatch->getMatchedRouteName());
$request = $this->getRequest();
$module = $this->params()->fromRoute('name', false);
$controller = $this->params()->fromRoute('controller_service_name', false);
$inputFilterName = $this->params()->fromRoute('input_filter_name', false);

/** @var Request $request */
$request = $this->getRequest();

if (! $module || ! $this->model->moduleExists($module)) {
return new ApiProblemResponse(
new ApiProblem(404, 'The module specified does not exist')
Expand Down
1 change: 1 addition & 0 deletions src/Controller/ModuleCreationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function __construct(ModuleModel $moduleModel)
/** @return ApiProblemResponse|ViewModel */
public function apiEnableAction()
{
/** @var Request $request */
$request = $this->getRequest();

switch ($request->getMethod()) {
Expand Down
1 change: 1 addition & 0 deletions src/Controller/PackageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public function __construct($zfdeployPath = null)
*/
public function indexAction()
{
/** @var Request $request */
$request = $this->getRequest();

switch ($request->getMethod()) {
Expand Down
1 change: 1 addition & 0 deletions src/Controller/SourceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function __construct(ModuleModel $moduleModel)
*/
public function sourceAction()
{
/** @var Request $request */
$request = $this->getRequest();

switch ($request->getMethod()) {
Expand Down
5 changes: 3 additions & 2 deletions src/InputFilter/AuthorizationInputFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Laminas\InputFilter\InputFilter;

use function array_keys;
use function in_array;
use function is_array;
use function strpos;
Expand Down Expand Up @@ -40,8 +41,8 @@ public function isValid($context = null)
continue;
}

foreach ($httpMethods as $httpMethod => $isRequired) {
if (! in_array($httpMethod, ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'])) {
foreach (array_keys($httpMethods) as $httpMethod) {
if (! in_array($httpMethod, ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'], true)) {
$this->messages[$className][] = 'Invalid HTTP method (' . $httpMethod . ') provided.';
$isValid = false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Listener/InjectModuleResourceLinksListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@

class InjectModuleResourceLinksListener
{
/** @var RouteMatch|V2RouteMatch */
/** @var null|RouteMatch|V2RouteMatch */
private $routeMatch;

/** @var callable */
/** @var null|callable */
private $urlHelper;

/** @var ContainerInterface */
Expand Down
2 changes: 1 addition & 1 deletion src/Model/AbstractAutodiscoveryModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
abstract class AbstractAutodiscoveryModel
{
/** @var ServiceLocatorInterface */
/** @var null|ServiceLocatorInterface */
protected $serviceLocator;

/** @var array */
Expand Down
2 changes: 0 additions & 2 deletions src/Model/AuthenticationModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -680,8 +680,6 @@ protected function createPdoDSN(string $dsn, ?string $username, ?string $passwor

/**
* Add a new authentication adapter in local config
*
* @return true
*/
protected function saveAuthenticationAdapter(array $adapter): bool
{
Expand Down
5 changes: 2 additions & 3 deletions src/Model/DbAutodiscoveryModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Laminas\Db\Metadata\Object\ColumnObject;
use Laminas\Db\Metadata\Object\ConstraintObject;

use function array_values;
use function in_array;
use function strpos;
use function strtolower;
Expand Down Expand Up @@ -113,7 +112,7 @@ public function fetchColumns($module, $version, $adapterName)

if (in_array(strtolower($column->getDataType()), ['varchar', 'text'])) {
$item['length'] = $column->getCharacterMaximumLength();
if (in_array('Primary key', array_values($item['constraints']))) {
if (in_array('Primary key', $item['constraints'])) {
unset($item['filters']);
unset($item['validators']);
$tableData['columns'][] = $item;
Expand All @@ -133,7 +132,7 @@ public function fetchColumns($module, $version, $adapterName)
])
) {
$item['length'] = $column->getNumericPrecision();
if (in_array('Primary key', array_values($item['constraints']))) {
if (in_array('Primary key', $item['constraints'])) {
unset($item['filters']);
unset($item['validators']);
$tableData['columns'][] = $item;
Expand Down
2 changes: 1 addition & 1 deletion test/Model/AuthorizationModelFactoryFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function setUp(): void
$this->container = $this->prophesize(ContainerInterface::class);
}

/** @psalm-return array<string, array{0: array<string, bool>}> */
/** @psalm-return array<string, array{0: array<class-string, bool>}> */
public function missingDependencies(): array
{
return [
Expand Down
2 changes: 1 addition & 1 deletion test/Model/ModuleVersioningModelFactoryFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function setUp(): void
$this->container = $this->prophesize(ContainerInterface::class);
}

/** @psalm-return array<string, array{0: array<string, bool>}> */
/** @psalm-return array<string, array{0: array<class-string, bool>}> */
public function missingDependencies(): array
{
return [
Expand Down
6 changes: 1 addition & 5 deletions test/Model/RestServiceModelFactoryFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ public function setUp(): void
$this->container = $this->prophesize(ContainerInterface::class);
}

/**
* @psalm-return array<string, array{
* 0: array<string, bool>
* }>
*/
/** @psalm-return array<string, array{0: array<non-empty-string, bool>}> */
public function missingDependencies(): array
{
return [
Expand Down
2 changes: 1 addition & 1 deletion test/Model/RpcServiceModelFactoryFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function setUp(): void
$this->container = $this->prophesize(ContainerInterface::class);
}

/** @psalm-return array<string, array{0: array<string, bool>}> */
/** @psalm-return array<string, array{0: array<non-empty-string, bool>}> */
public function missingDependencies(): array
{
return [
Expand Down
2 changes: 1 addition & 1 deletion test/Model/VersioningModelFactoryFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function setUp(): void
$this->container = $this->prophesize(ContainerInterface::class);
}

/** @psalm-return array<string, array{0: array<string, bool>}> */
/** @psalm-return array<string, array{0: array<class-string, bool>}> */
public function missingDependencies(): array
{
return [
Expand Down

0 comments on commit 98513d4

Please sign in to comment.