Skip to content

Commit

Permalink
migrate packages from zendframework to laminas and mezzio
Browse files Browse the repository at this point in the history
  • Loading branch information
Lansoweb committed Jan 2, 2020
1 parent 26d4018 commit 3dbd121
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 26 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 1.0.0 - TBD

### Added

- Nothing.

### Changed

- migrate packages from zendframework to laminas

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- Nothing.

## 0.4.0 - 2018-04-19

### Added
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This library utilizes url query parameters and generates db queries.

At this moment, it provides integration with:

- [zend-db](https://github.com/zendframework/zend-db/)
- [zend-db](https://github.com/laminas/laminas-db/)

Planned:

Expand Down Expand Up @@ -39,7 +39,7 @@ Passing the request directly:
```php
public function handle(ServerRequestInterface $request): ResponseInterface
{
$select = new \Zend\Db\Select('table');
$select = new \Laminas\Db\Select('table');
$select = (new ZendDbBuilder($select))->fromRequest($request);
$statement = $sql->prepareStatementForSqlObject($select);
$results = $statement->execute();
Expand All @@ -54,7 +54,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
$query = $queryParams['q'] ?? [];
$hint = $queryParams['h'] ?? [];

$select = new \Zend\Db\Select('table');
$select = new \Laminas\Db\Select('table');
$select = (new ZendDbBuilder($select))->fromParams($query, $hint);
$statement = $sql->prepareStatementForSqlObject($select);
$results = $statement->execute();
Expand Down
32 changes: 17 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
{
"name" : "los/uql",
"description" : "PHP library to transform url query into db partial queries",
"license" : "MIT",
"type" : "library",
"homepage" : "https://github.com/lansoweb/uql",
"authors" : [ {
"name" : "Leandro Silva",
"homepage" : "http://leandrosilva.info/"
} ],
"name": "los/uql",
"description": "PHP library to transform url query into db partial queries",
"license": "MIT",
"type": "library",
"homepage": "https://github.com/lansoweb/uql",
"authors": [
{
"name": "Leandro Silva",
"homepage": "http://leandrosilva.info/"
}
],
"require": {
"php": "^7.1",
"psr/http-message": "^1.0"
},
"require-dev": {
"zendframework/zend-db": "^2.9",
"zendframework/zend-coding-standard": "^1.0",
"laminas/laminas-db": "^2.9",
"laminas/laminas-coding-standard": "^1.0",
"squizlabs/php_codesniffer": "^2.7",
"phpstan/phpstan": "^0.9.2",
"phpunit/phpunit": "^7.1",
"zendframework/zend-diactoros": "^1.7",
"laminas/laminas-diactoros": "^1.7",
"php-coveralls/php-coveralls": "^2.0"
},
"autoload" : {
"psr-4" : {
"Los\\Uql\\" : "src/"
"autoload": {
"psr-4": {
"Los\\Uql\\": "src/"
}
},
"autoload-dev": {
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<ruleset name="Zend Framework Coding Standard">
<rule ref="./vendor/zendframework/zend-coding-standard/ruleset.xml"/>
<rule ref="./vendor/laminas/laminas-coding-standard/ruleset.xml"/>

<!-- Paths to check -->
<file>src</file>
Expand Down
8 changes: 4 additions & 4 deletions src/ZendDbBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
namespace Los\Uql;

use Psr\Http\Message\ServerRequestInterface;
use Zend\Db\Sql\Predicate\IsNotNull;
use Zend\Db\Sql\Predicate\IsNull;
use Zend\Db\Sql\Predicate\Predicate;
use Zend\Db\Sql\Select;
use Laminas\Db\Sql\Predicate\IsNotNull;
use Laminas\Db\Sql\Predicate\IsNull;
use Laminas\Db\Sql\Predicate\Predicate;
use Laminas\Db\Sql\Select;

final class ZendDbBuilder implements BuilderInterface
{
Expand Down
2 changes: 1 addition & 1 deletion test/TestAssets/TrustingSql92Platform.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Los\UqlTests\TestAssets;

use Zend\Db\Adapter\Platform\Sql92;
use Laminas\Db\Adapter\Platform\Sql92;

class TrustingSql92Platform extends Sql92
{
Expand Down
4 changes: 2 additions & 2 deletions test/ZendDbBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use Los\Uql\ZendDbBuilder;
use Los\UqlTests\TestAssets\TrustingSql92Platform;
use PHPUnit\Framework\TestCase;
use Zend\Db\Sql\Select;
use Zend\Diactoros\ServerRequest;
use Laminas\Db\Sql\Select;
use Laminas\Diactoros\ServerRequest;

class ZendDbBuilderTest extends TestCase
{
Expand Down

0 comments on commit 3dbd121

Please sign in to comment.