Skip to content

Commit 11a8b2a

Browse files
committed
Merge branch 'phpspec5'
2 parents be2d53a + a4c0495 commit 11a8b2a

30 files changed

+84
-73
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# CHANGELOG
22

3+
## 0.9.0: phpspec 5
4+
5+
Upgraded phpspec to v5.0@rc, meaning:
6+
7+
* phpspec v4 support was dropped
8+
* PHP 7.0 support was dropped
9+
* Symfony 2.7, 3.0, 3.1, 3.2 and 3.3 was dropped
10+
* added usage of void return type
11+
* added usage of constant visibility
12+
313
## 0.8.5: Normalized float to double
414

515
Normalization from float to double, thanks to @ItsKelsBoys

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015-2017 Loïc Faugeron
1+
Copyright (c) 2015-2018 Loïc Faugeron
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Memio's SpecGen [![SensioLabsInsight](https://insight.sensiolabs.com/projects/7cea8bf7-2f9f-4d34-a7e8-55fabeed867f/mini.png)](https://insight.sensiolabs.com/projects/7cea8bf7-2f9f-4d34-a7e8-55fabeed867f) [![Travis CI](https://travis-ci.org/memio/spec-gen.png)](https://travis-ci.org/memio/spec-gen)
1+
# Memio's SpecGen [![Travis CI](https://travis-ci.org/memio/spec-gen.png)](https://travis-ci.org/memio/spec-gen)
22

33
This extension for [phpspec](http://phpspec.net/) provides a powerful code generator:
44

@@ -19,7 +19,7 @@ This extension for [phpspec](http://phpspec.net/) provides a powerful code gener
1919

2020
First install it using [Composer](https://getcomposer.org/download):
2121

22-
composer require --dev memio/spec-gen:^0.8
22+
composer require --dev memio/spec-gen:^0.9
2323

2424
Then enable it in `phpspec.yml`:
2525

@@ -30,7 +30,8 @@ extensions:
3030

3131
> **Version guide**:
3232
>
33-
> * using phpspec 4? Then use spec-gen v0.8 and above
33+
> * using phpspec 5? Then use spec-gen v0.9
34+
> * using phpspec 4? Then use spec-gen v0.8
3435
> * using phpspec 3 and PHP 7? Then use spec-gen v0.7
3536
> * using phpspec 3 and PHP 5.6? Then use spec-gen v0.6
3637
> * using phpspec 2? Then use spec-gen v0.4

composer.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,12 @@
3232
"memio/model": "^2.0.1",
3333
"memio/pretty-printer": "^2.0",
3434
"memio/twig-template-engine": "^2.0.1",
35-
"php": "^7.0",
36-
"phpspec/phpspec": "^4.0",
37-
"symfony/event-dispatcher": "^2.7 || ^3.0 || ^4.0"
35+
"php": "^7.1",
36+
"phpspec/phpspec": "^5.0@rc",
37+
"symfony/event-dispatcher": "^3.4 || ^4.0"
3838
},
3939
"require-dev": {
40-
"friendsofphp/php-cs-fixer": "^2.0",
41-
"phpunit/phpunit": "^6.0 || ^7.0"
42-
},
43-
"extra": {
44-
"branch-alias": {
45-
"dev-master": "2.1-dev"
46-
}
40+
"friendsofphp/php-cs-fixer": "^2.12",
41+
"phpunit/phpunit": "^7.2"
4742
}
4843
}

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<!-- http://phpunit.de/manual/current/en/appendixes.configuration.html -->
4-
0<phpunit backupGlobals="false" colors="true" bootstrap="vendor/autoload.php">
4+
<phpunit backupGlobals="false" colors="true" bootstrap="vendor/autoload.php">
55
<testsuites>
66
<testsuite name="Integration Tests">
77
<directory>tests</directory>

src/Memio/SpecGen/CodeEditor/CodeEditor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ public function open(string $filename): File
3535
return $this->editor->open($filename);
3636
}
3737

38-
public function save(File $file)
38+
public function save(File $file): void
3939
{
4040
$this->editor->save($file);
4141
}
4242

43-
public function handle(Command $command)
43+
public function handle(Command $command): void
4444
{
4545
$this->commandBus->handle($command);
4646
}

src/Memio/SpecGen/CodeEditor/InsertConstructorHandler.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
class InsertConstructorHandler implements CommandHandler
2020
{
21-
const CONSTRUCTOR = '/function __construct\(/';
22-
const METHOD = '/^ public function /';
23-
const CLASS_ENDING = '/^}$/';
21+
public const CONSTRUCTOR = '/function __construct\(/';
22+
public const METHOD = '/^ public function /';
23+
public const CLASS_ENDING = '/^}$/';
2424

2525
private $editor;
2626
private $prettyPrinter;
@@ -36,7 +36,7 @@ public function supports(Command $command): bool
3636
return $command instanceof InsertConstructor;
3737
}
3838

39-
public function handle(Command $command)
39+
public function handle(Command $command): void
4040
{
4141
if ($this->editor->hasBelow($command->file, self::CONSTRUCTOR, 0)) {
4242
return;

src/Memio/SpecGen/CodeEditor/InsertMethodHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class InsertMethodHandler implements CommandHandler
2020
{
21-
const CLASS_ENDING = '/^}$/';
21+
public const CLASS_ENDING = '/^}$/';
2222

2323
private $editor;
2424
private $prettyPrinter;
@@ -34,7 +34,7 @@ public function supports(Command $command): bool
3434
return $command instanceof InsertMethod;
3535
}
3636

37-
public function handle(Command $command)
37+
public function handle(Command $command): void
3838
{
3939
$methodPattern = '/^ public function '.$command->method->getName().'\(/';
4040
if ($this->editor->hasBelow($command->file, $methodPattern, 0)) {

src/Memio/SpecGen/CodeEditor/InsertPropertiesHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function supports(Command $command): bool
2828
return $command instanceof InsertProperties;
2929
}
3030

31-
public function handle(Command $command)
31+
public function handle(Command $command): void
3232
{
3333
foreach ($command->properties as $property) {
3434
$this->insertPropertyHandler->handle(new InsertProperty($command->file, $property));

src/Memio/SpecGen/CodeEditor/InsertPropertyHandler.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
class InsertPropertyHandler implements CommandHandler
2020
{
21-
const CLASS_OPENING = '/^{$/';
22-
const CLASS_ENDING = '/^}$/';
23-
const CONSTANT = '/^ const /';
24-
const PROPERTY = '/^ private \$/';
21+
public const CLASS_OPENING = '/^{$/';
22+
public const CLASS_ENDING = '/^}$/';
23+
public const CONSTANT = '/^ const /';
24+
public const PROPERTY = '/^ private \$/';
2525

2626
private $editor;
2727
private $prettyPrinter;
@@ -37,7 +37,7 @@ public function supports(Command $command): bool
3737
return $command instanceof InsertProperty;
3838
}
3939

40-
public function handle(Command $command)
40+
public function handle(Command $command): void
4141
{
4242
$propertyStatement = '/^ private \$'.$command->property->getName().';$/';
4343
if ($this->editor->hasBelow($command->file, $propertyStatement, 0)) {

0 commit comments

Comments
 (0)