Skip to content

Commit f30fc20

Browse files
committed
Merge branch 'master' into fix-context-warnings-empty
2 parents 84c3012 + be4fab8 commit f30fc20

148 files changed

Lines changed: 5256 additions & 13 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
composer.lock
22
vendor
33
.idea
4-
phpda.phar
4+
phpda.phar
5+
tests/_output/*

codeception.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
actor: Tester
2+
paths:
3+
tests: tests
4+
log: tests/_output
5+
data: tests/_data
6+
support: tests/_support
7+
settings:
8+
bootstrap: _bootstrap.php
9+
colors: true
10+
memory_limit: 1024M
11+
extensions:
12+
enabled:
13+
- Codeception\Extension\RunFailed

composer.json

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mamuz/php-dependency-analysis",
33
"type": "project",
4-
"description": "Static code analysis to provide and verify a dependency graph against a defined architecture",
4+
"description": "Static code analysis tool to verify an autogenerated dependency graph against a defined architecture",
55
"homepage": "https://github.com/mamuz/PhpDependencyAnalysis",
66
"license": "MIT",
77
"keywords": [
@@ -21,9 +21,8 @@
2121
"issues": "https://github.com/mamuz/PhpDependencyAnalysis/issues",
2222
"source": "https://github.com/mamuz/PhpDependencyAnalysis"
2323
},
24-
"scripts": {
25-
"test": "phpunit",
26-
"build": "box build -v"
24+
"config": {
25+
"optimize-autoloader": true
2726
},
2827
"minimum-stability": "dev",
2928
"prefer-stable": true,
@@ -42,14 +41,24 @@
4241
},
4342
"require-dev": {
4443
"phpunit/phpunit": "~4.0",
45-
"mockery/mockery": "~0.9.2"
44+
"mockery/mockery": "~0.9.2",
45+
"codeception/codeception": "^2.2"
4646
},
4747
"autoload": {
4848
"psr-4": {
4949
"PhpDA\\": "src/"
5050
}
5151
},
52+
"autoload-dev": {
53+
"psr-4": {
54+
"PhpDATest\\": "tests/unit/"
55+
}
56+
},
5257
"bin": [
5358
"bin/phpda"
54-
]
59+
],
60+
"scripts": {
61+
"test": "phpunit",
62+
"build": "box build -v"
63+
}
5564
}

phpunit.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<phpunit bootstrap="./tests/Bootstrap.php" colors="true">
3+
<phpunit bootstrap="./tests/unit/_bootstrap.php" colors="true">
44
<testsuites>
55
<testsuite name="PhpDa Testsuite">
6-
<directory>./tests</directory>
6+
<directory>./tests/unit</directory>
77
</testsuite>
88
</testsuites>
99
<listeners>

tests/_bootstrap.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
// This is global bootstrap for autoloading
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace PackageA\Controller;
4+
5+
use Zend\Http\Request as HttpRequest;
6+
use Zend\Mvc\Controller\AbstractController as AbstractZendController;
7+
8+
abstract class AbstractController extends AbstractZendController
9+
{
10+
/**
11+
* @return HttpRequest
12+
*/
13+
protected function getRequest()
14+
{
15+
return new HttpRequest();
16+
}
17+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
namespace PackageA\Controller;
4+
5+
use PackageA\Service\Command as CommandService;
6+
7+
class Command extends AbstractController
8+
{
9+
/** @var CommandService */
10+
private $service;
11+
12+
public function __construct(CommandService $service)
13+
{
14+
$this->service = $service;
15+
}
16+
17+
public function createAction()
18+
{
19+
$request = $this->getRequest();
20+
$data = $request->getPostData();
21+
22+
$this->service->persist($data);
23+
}
24+
25+
public function updateAction()
26+
{
27+
$request = $this->getRequest();
28+
$data = $request->getPostData();
29+
30+
$this->service->persist($data);
31+
}
32+
33+
public function deleteAction()
34+
{
35+
$request = $this->getRequest();
36+
$data = $request->getPostData();
37+
38+
$this->service->delete($data['id']);
39+
}
40+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace PackageA\Controller;
4+
5+
use PackageA\Service\Query as QueryService;
6+
7+
class Query extends AbstractController
8+
{
9+
/** @var QueryService */
10+
private $service;
11+
12+
public function __construct(QueryService $service)
13+
{
14+
$this->service = $service;
15+
}
16+
17+
public function readAction()
18+
{
19+
$request = $this->getRequest();
20+
$data = $request->getQueryData();
21+
22+
$this->service->find($data);
23+
}
24+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace PackageA\Entity;
4+
5+
class Package
6+
{
7+
8+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace PackageA\Mapper;
4+
5+
use PackageA\Entity\Package;
6+
7+
class Command implements CommandInterface
8+
{
9+
use EntityManagerAwareTrait;
10+
11+
public function persist(Package $pacakge)
12+
{
13+
$this->getEntityManager()->persist($pacakge);
14+
}
15+
16+
public function delete(Package $pacakge)
17+
{
18+
$this->getEntityManager()->delete($pacakge);
19+
}
20+
}

0 commit comments

Comments
 (0)