-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 57280c7
Showing
5 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# random-integer-number | ||
Example component for OXID eShop 6.2 Services | ||
|
||
### Install as package | ||
`composer require michaelkeiluweit/random-integer-number` | ||
|
||
### Example usage | ||
```php | ||
<?php | ||
|
||
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory; | ||
use MichaelKeiluweit\RandomIntegerNumber\RandomIntegerNumberInterface; | ||
|
||
require_once 'bootstrap.php'; | ||
|
||
/** @var RandomIntegerNumberInterface $randomIntegerNumber */ | ||
$randomIntegerNumber = ContainerFactory::getInstance()->getContainer()->get(RandomIntegerNumberInterface::class); | ||
|
||
echo 'random_number: ' . $randomIntegerNumber->shuffle(); | ||
echo PHP_EOL; | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "michaelkeiluweit/random-integer-number", | ||
"type": "oxideshop-component", | ||
"require": { | ||
"php": ">=7.4", | ||
"oxid-esales/oxideshop-metapackage-ce": "^v6.2.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"MichaelKeiluweit\\RandomIntegerNumber\\": "src/" | ||
} | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "1.x-dev" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
services: | ||
MichaelKeiluweit\RandomIntegerNumber\RandomIntegerNumberInterface: | ||
class: MichaelKeiluweit\RandomIntegerNumber\RandomIntegerNumber | ||
autowire: true | ||
public: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
|
||
namespace MichaelKeiluweit\RandomIntegerNumber; | ||
|
||
|
||
class RandomIntegerNumber implements RandomIntegerNumberInterface | ||
{ | ||
public function shuffle(): int | ||
{ | ||
return rand(0, PHP_INT_MAX); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
|
||
namespace MichaelKeiluweit\RandomIntegerNumber; | ||
|
||
|
||
interface RandomIntegerNumberInterface | ||
{ | ||
public function shuffle(): int; | ||
} |