Skip to content

Commit

Permalink
Merge pull request #1 from vbpupil/feature/php_8_version
Browse files Browse the repository at this point in the history
Php 8.1 Compatible
  • Loading branch information
vbpupil committed Sep 6, 2022
2 parents 58318bf + fe6f039 commit 19b5e8b
Show file tree
Hide file tree
Showing 11 changed files with 1,119 additions and 651 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Dean Haines
Copyright (c) 2022 Dean Haines

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@
# Queue Data Structure

A simple Queue data structure mechanism which allows you to set a max limit of items
you wish to carry. After the max amount is met any subsequent additions will knock off
you wish to hold. After the max amount is met any subsequent additions will knock off
items from the end.

## Sample Usage

```php
// create a new queue and specify a limit - here we have set it to hold 1 item.
$q = new queue(1);

$q->addItem(1)
->addItem(2)
->addItem(3)
->addItem(4)
->addItem(5);
//add items
$q->addItem('Item 1')
->addItem('Item 2')
->addItem('Item 3')
->addItem('Item 4')
->addItem('Item 5');

dump($q->getItems());
echo($q->getItems());
```

The above example will return 1 item with the value of **5**.
The above example will return 1 item with the value of **Item 5**.
28 changes: 20 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
{
"name" : "vbpupil/queue",
"description" : "A simple Queue data structure.",
"name": "vbpupil/queue",
"description": "A simple Queue data structure.",
"version": "2.0.0",
"license": "MIT",
"autoload" : {
"psr-4" : {
"vbpupil\\" : "src"
"php": ">=8.1",
"authors": [
{
"name": "Dean Haines",
"email": "[email protected]"
}
],
"autoload": {
"psr-4": {
"vbpupil\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"test\\vbpupil\\": "test/src"
}
},
"require-dev" : {
"phpunit/phpunit" : "*",
"symfony/var-dumper" : "3.3.2"
"require-dev": {
"phpunit/phpunit": "9.3.3"
}
}
Loading

0 comments on commit 19b5e8b

Please sign in to comment.