Skip to content

Commit

Permalink
Upgrade symfony 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
pix-art committed Jul 24, 2019
1 parent b46bc70 commit b04b205
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ How to run tests?
-----------------

```
php bin/phpunit
```
Expand All @@ -50,25 +50,25 @@ Smart codes have to be bound to a payload this can be done by implementing the P
```
use Intracto\SmartCodeBundle\Entity\PayloadInterface;
use Intracto\SmartCodeBundle\Entity\SmartCodeInterface;
class Payload implements PayloadInterface
{
...
/**
* @ORM\OneToMany(targetEntity="Intracto\SmartCodeBundle\Entity\SmartCodeInterface", mappedBy="payload")
*
* @var SmartCodes[]|ArrayCollection
*/
protected $smartCodes;
...
}
```

Now you can get started with the generation. To generate Smart codes you can use the SmartCodeGenerator
or create your own by implementing the SmartCodeGeneratorInterface.
or create your own by implementing the SmartCodeGeneratorInterface.

This service will allow you to call the function:

Expand All @@ -77,7 +77,7 @@ This service will allow you to call the function:
```

As you can see this has 2 parameters, the first is your payload that you created in step 1 and the 2nd is a model
containing all your options.
containing all your options.

```
class SmartCodeOptions
Expand All @@ -87,7 +87,7 @@ containing all your options.
protected $expiresAt;
protected $startsAt;
protected $batch;
...
}
```
Expand All @@ -100,16 +100,16 @@ containing all your options.

The last thing you would probably want to do is to be able to use these smart codes you just generated.
This is possible via the SmartCodeAction service, which you can also overwrite by implementing the SmartCodeActionInterface.

This class has 2 required functions:

```
public function register(SubjectInterface $subject, SmartCodeInterface $smartCode);
public function unregister(SubjectInterface $subject, SmartCodeInterface $smartCode);
```

To register or unregister a certain smart code you would need a subject that is going to be using this code.
To register or unregister a certain smart code you would need a subject that is going to be using this code.
To make such a subject you can implement the SubjectInterface.

```
Expand All @@ -118,9 +118,9 @@ To make such a subject you can implement the SubjectInterface.
class User implements SubjectInterface
{
...
/**
* @ORM\ManyToMany(targetEntity="Intracto\SmartCodeBundle\Entity\SmartCodeInterface", inversedBy="subjects")
* @ORM\JoinTable(name="user_smartcode",
Expand All @@ -131,9 +131,9 @@ To make such a subject you can implement the SubjectInterface.
* @var SmartCode[]|ArrayCollection
*/
protected $smartCodes;
...
}
```
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
],

"require": {
"php": ">=5.3.9",
"doctrine/orm": "~2.2",
"symfony/framework-bundle": "~2.3",
"symfony/validator": "~2.3"
"php": ">=7.2",
"doctrine/orm": "~2.4",
"symfony/framework-bundle": "~3.4",
"symfony/validator": "~3.4"
},

"config": {
Expand All @@ -32,4 +32,4 @@
},

"target-dir": "Intracto/SmartCodeBundle"
}
}

0 comments on commit b04b205

Please sign in to comment.