diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 7c326ae..973eaba 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,12 +5,9 @@ + + - - - - - @@ -39,7 +36,7 @@ - + @@ -56,11 +53,11 @@ - + - - + + @@ -69,7 +66,7 @@ - + @@ -79,7 +76,7 @@ - + @@ -89,7 +86,7 @@ - + @@ -99,8 +96,28 @@ - - + + + + + + + + + + + + + + + + + + + + + + @@ -109,8 +126,8 @@ - - + + @@ -168,14 +185,18 @@ @@ -219,10 +240,8 @@ - @@ -326,6 +345,52 @@ - - - - - - @@ -813,9 +873,15 @@ + + + + + + - @@ -827,22 +893,22 @@ - + - - + + @@ -938,26 +1004,10 @@ - - - - - - - - - - - - - - - - @@ -980,7 +1030,6 @@ - @@ -996,7 +1045,6 @@ - @@ -1228,7 +1276,6 @@ - @@ -1239,33 +1286,17 @@ - - - - - - - - - + - - - - - - - - - + @@ -1275,13 +1306,12 @@ - - + @@ -1295,18 +1325,50 @@ + + + + + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Coffee/Queue.php b/src/Coffee/Queue.php new file mode 100644 index 0000000..b83dca0 --- /dev/null +++ b/src/Coffee/Queue.php @@ -0,0 +1,30 @@ +queue[] = $element; + } + + /** + * @return mixed + */ + public function pop() { + return array_shift($this->queue); + } +} \ No newline at end of file diff --git a/tests/Coffee/QueueTest.php b/tests/Coffee/QueueTest.php new file mode 100644 index 0000000..9ee9e50 --- /dev/null +++ b/tests/Coffee/QueueTest.php @@ -0,0 +1,18 @@ +push('1'); + $queue->push('2'); + $queue->push('3'); + + $this->assertEquals('1', $queue->pop()); + } +}