Composer update

master
Peter Babič 8 years ago
parent 6e987c5a69
commit d76f5f230b
Signed by: peter.babic
GPG Key ID: 4BB075BC1884BA40
  1. 27
      .idea/coffeetable.iml
  2. 9
      .idea/inspectionProfiles/Project_Default.xml
  3. 7
      .idea/inspectionProfiles/profiles_settings.xml
  4. 266
      .idea/workspace.xml
  5. 3
      composer.json
  6. 274
      composer.lock
  7. 272
      src/Coffee/Map.php
  8. 368
      src/Coffee/Position.php
  9. 76
      src/Coffee/Spot.php
  10. 98
      src/Coffee/Table.php
  11. 137
      src/Coffee/Tile.php
  12. 226
      tests/Coffee/MapTest.php
  13. 28
      tests/Coffee/PositionTest.php
  14. 10
      tests/Coffee/SpotTest.php
  15. 51
      tests/Coffee/TableTest.php
  16. 40
      tests/Coffee/TileTest.php

@ -3,10 +3,14 @@
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/vendor" />
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/instantiator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" />
<excludeFolder url="file://$MODULE_DIR$/vendor/pdepend/pdepend" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-docblock" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpmd/phpmd" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpspec/prophecy" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" />
@ -24,6 +28,9 @@
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/resource-operations" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/version" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/config" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/dependency-injection" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/filesystem" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/yaml" />
</content>
<orderEntry type="inheritedJdk" />
@ -34,7 +41,9 @@
<root url="file://$MODULE_DIR$/vendor/composer" />
<root url="file://$MODULE_DIR$/vendor/doctrine/instantiator" />
<root url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" />
<root url="file://$MODULE_DIR$/vendor/pdepend/pdepend" />
<root url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-docblock" />
<root url="file://$MODULE_DIR$/vendor/phpmd/phpmd" />
<root url="file://$MODULE_DIR$/vendor/phpspec/prophecy" />
<root url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" />
<root url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" />
@ -52,13 +61,18 @@
<root url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" />
<root url="file://$MODULE_DIR$/vendor/sebastian/resource-operations" />
<root url="file://$MODULE_DIR$/vendor/sebastian/version" />
<root url="file://$MODULE_DIR$/vendor/symfony/config" />
<root url="file://$MODULE_DIR$/vendor/symfony/dependency-injection" />
<root url="file://$MODULE_DIR$/vendor/symfony/filesystem" />
<root url="file://$MODULE_DIR$/vendor/symfony/yaml" />
</CLASSES>
<SOURCES>
<root url="file://$MODULE_DIR$/vendor/composer" />
<root url="file://$MODULE_DIR$/vendor/doctrine/instantiator" />
<root url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" />
<root url="file://$MODULE_DIR$/vendor/pdepend/pdepend" />
<root url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-docblock" />
<root url="file://$MODULE_DIR$/vendor/phpmd/phpmd" />
<root url="file://$MODULE_DIR$/vendor/phpspec/prophecy" />
<root url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" />
<root url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" />
@ -76,9 +90,22 @@
<root url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" />
<root url="file://$MODULE_DIR$/vendor/sebastian/resource-operations" />
<root url="file://$MODULE_DIR$/vendor/sebastian/version" />
<root url="file://$MODULE_DIR$/vendor/symfony/config" />
<root url="file://$MODULE_DIR$/vendor/symfony/dependency-injection" />
<root url="file://$MODULE_DIR$/vendor/symfony/filesystem" />
<root url="file://$MODULE_DIR$/vendor/symfony/yaml" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="PHARS">
<CLASSES>
<root url="phar://$MODULE_DIR$/vendor/symfony/dependency-injection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar/" />
</CLASSES>
<SOURCES>
<root url="phar://$MODULE_DIR$/vendor/symfony/dependency-injection/Tests/Fixtures/includes/ProjectWithXsdExtensionInPhar.phar/" />
</SOURCES>
</library>
</orderEntry>
</component>
</module>

@ -0,0 +1,9 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<option name="myLocal" value="true" />
<inspection_tool class="MessDetectorValidationInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false">
<option name="UNUSEDCODE" value="true" />
</inspection_tool>
</profile>
</component>

@ -0,0 +1,7 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="Project Default" />
<option name="USE_PROJECT_PROFILE" value="true" />
<version value="1.0" />
</settings>
</component>

@ -4,8 +4,23 @@
<option name="ANALYZE_TEST_SOURCES" value="false" />
</component>
<component name="ChangeListManager">
<list default="true" id="65f95bb6-3a86-4ed6-841e-441936291ad4" name="Default" comment="BLA BLA BLA">
<list default="true" id="65f95bb6-3a86-4ed6-841e-441936291ad4" name="Default" comment="Rework Table constructor">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/profiles_settings.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/coffeetable.iml" afterPath="$PROJECT_DIR$/.idea/coffeetable.iml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/composer.json" afterPath="$PROJECT_DIR$/composer.json" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/composer.lock" afterPath="$PROJECT_DIR$/composer.lock" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Coffee/Map.php" afterPath="$PROJECT_DIR$/src/Coffee/Map.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Coffee/Position.php" afterPath="$PROJECT_DIR$/src/Coffee/Position.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Coffee/Spot.php" afterPath="$PROJECT_DIR$/src/Coffee/Spot.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Coffee/Table.php" afterPath="$PROJECT_DIR$/src/Coffee/Table.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/Coffee/Tile.php" afterPath="$PROJECT_DIR$/src/Coffee/Tile.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/tests/Coffee/MapTest.php" afterPath="$PROJECT_DIR$/tests/Coffee/MapTest.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/tests/Coffee/PositionTest.php" afterPath="$PROJECT_DIR$/tests/Coffee/PositionTest.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/tests/Coffee/SpotTest.php" afterPath="$PROJECT_DIR$/tests/Coffee/SpotTest.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/tests/Coffee/TableTest.php" afterPath="$PROJECT_DIR$/tests/Coffee/TableTest.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/tests/Coffee/TileTest.php" afterPath="$PROJECT_DIR$/tests/Coffee/TileTest.php" />
</list>
<ignored path="coffeetable.iws" />
<ignored path=".idea/workspace.xml" />
@ -31,21 +46,11 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="index.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/index.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-6.0">
<caret line="9" column="21" selection-start-line="9" selection-start-column="21" selection-end-line="9" selection-end-column="21" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Table.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Coffee/Table.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-23.333334">
<caret line="50" column="0" selection-start-line="50" selection-start-column="0" selection-end-line="50" selection-end-column="0" />
<state vertical-scroll-proportion="-17.703703">
<caret line="68" column="0" selection-start-line="68" selection-start-column="0" selection-end-line="68" selection-end-column="0" />
<folding />
</state>
</provider>
@ -54,7 +59,7 @@
<file leaf-file-name="Spot.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Coffee/Spot.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-10.666667">
<state vertical-scroll-proportion="-12.37037">
<caret line="39" column="7" selection-start-line="39" selection-start-column="7" selection-end-line="39" selection-end-column="7" />
<folding />
</state>
@ -64,7 +69,7 @@
<file leaf-file-name="Position.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Coffee/Position.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-116.111115">
<state vertical-scroll-proportion="-9.703704">
<caret line="175" column="23" selection-start-line="175" selection-start-column="23" selection-end-line="175" selection-end-column="23" />
<folding />
</state>
@ -74,8 +79,8 @@
<file leaf-file-name="Map.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Coffee/Map.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-6.0">
<caret line="75" column="33" selection-start-line="75" selection-start-column="33" selection-end-line="75" selection-end-column="33" />
<state vertical-scroll-proportion="-7.3333335">
<caret line="35" column="7" selection-start-line="35" selection-start-column="7" selection-end-line="35" selection-end-column="7" />
<folding />
</state>
</provider>
@ -84,8 +89,28 @@
<file leaf-file-name="MapTest.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/tests/Coffee/MapTest.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.79752064">
<caret line="47" column="52" selection-start-line="47" selection-start-column="52" selection-end-line="47" selection-end-column="52" />
<state vertical-scroll-proportion="0.28877005">
<caret line="12" column="0" selection-start-line="12" selection-start-column="0" selection-end-line="12" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="SpotTest.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/tests/Coffee/SpotTest.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="TableTest.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/tests/Coffee/TableTest.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-6.6666665">
<caret line="10" column="22" selection-start-line="10" selection-start-column="22" selection-end-line="10" selection-end-column="22" />
<folding />
</state>
</provider>
@ -94,13 +119,33 @@
<file leaf-file-name="Tile.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Coffee/Tile.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-2.3703704">
<state vertical-scroll-proportion="-0.6666667">
<caret line="38" column="6" selection-start-line="38" selection-start-column="6" selection-end-line="38" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="TileTest.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/tests/Coffee/TileTest.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="PositionTest.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/tests/Coffee/PositionTest.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-18.660378">
<caret line="103" column="76" selection-start-line="103" selection-start-column="76" selection-end-line="103" selection-end-column="76" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FrameworkCommandLineHistory">
@ -108,11 +153,15 @@
<command text="composer update" />
<command text="git rm . --cached" />
<command text="git rm -r . --cached" />
<command text="composer update" />
</commandsHistory>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="HighlightingSettingsPerFile">
<setting file="mock:///Dummy.txt" root0="SKIP_INSPECTION" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
@ -137,22 +186,22 @@
<option value="$PROJECT_DIR$/tests/SpotTest.php" />
<option value="$PROJECT_DIR$/tests/TileTest.php" />
<option value="$PROJECT_DIR$/phpunit.xml" />
<option value="$PROJECT_DIR$/composer.json" />
<option value="/usr/share/nginx/html/coffeetable/src/Coffee/Map.php" />
<option value="/usr/share/nginx/html/coffeetable/src/Coffee/Tile.php" />
<option value="$PROJECT_DIR$/tests/Coffee/PositionTest.php" />
<option value="$PROJECT_DIR$/src/Coffee/Position.php" />
<option value="$PROJECT_DIR$/tests/Coffee/TileTest.php" />
<option value="/usr/share/nginx/html/coffeetable/src/Coffee/Spot.php" />
<option value="$PROJECT_DIR$/tests/Coffee/SpotTest.php" />
<option value="$PROJECT_DIR$/src/Coffee/Spot.php" />
<option value="/usr/share/nginx/html/coffeetable/index.php" />
<option value="$PROJECT_DIR$/src/Coffee/Tile.php" />
<option value="$PROJECT_DIR$/tests/Coffee/MapTest.php" />
<option value="$PROJECT_DIR$/src/Coffee/Map.php" />
<option value="$PROJECT_DIR$/src/Coffee/Table.php" />
<option value="$PROJECT_DIR$/tests/Coffee/TableTest.php" />
<option value="$PROJECT_DIR$/index.php" />
<option value="$PROJECT_DIR$/composer.json" />
<option value="$PROJECT_DIR$/tests/Coffee/PositionTest.php" />
<option value="$PROJECT_DIR$/src/Coffee/Map.php" />
<option value="$PROJECT_DIR$/tests/Coffee/MapTest.php" />
<option value="$PROJECT_DIR$/tests/Coffee/SpotTest.php" />
<option value="$PROJECT_DIR$/tests/Coffee/TableTest.php" />
<option value="$PROJECT_DIR$/tests/Coffee/TileTest.php" />
</list>
</option>
</component>
@ -188,6 +237,11 @@
<path value="$PROJECT_DIR$/vendor/doctrine/instantiator" />
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/phpunit/phpunit" />
<path value="$PROJECT_DIR$/vendor/symfony/dependency-injection" />
<path value="$PROJECT_DIR$/vendor/symfony/filesystem" />
<path value="$PROJECT_DIR$/vendor/symfony/config" />
<path value="$PROJECT_DIR$/vendor/pdepend/pdepend" />
<path value="$PROJECT_DIR$/vendor/phpmd/phpmd" />
</include_path>
</component>
<component name="ProjectFrameBounds">
@ -274,9 +328,6 @@
<State>
<id>Spelling</id>
</State>
<State>
<id>UndefinedPHP</id>
</State>
<State>
<id>XML</id>
</State>
@ -286,7 +337,27 @@
</expanded-state>
<selected-state>
<State>
<id>PhpUndefinedFieldInspection</id>
<id>PhpCSValidationInspection</id>
</State>
</selected-state>
</profile-state>
</entry>
<entry key="Project Default (copy)">
<profile-state>
<expanded-state>
<State>
<id />
</State>
<State>
<id>PHP</id>
</State>
<State>
<id>UnusedPHP</id>
</State>
</expanded-state>
<selected-state>
<State>
<id>MessDetectorValidationInspection</id>
</State>
</selected-state>
</profile-state>
@ -395,7 +466,7 @@
<property name="options.splitter.main.proportions" value="0.3" />
<property name="options.splitter.details.proportions" value="0.2" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="SearchEverywhereHistoryKey" value="replace in pa&#9;ACTION&#9;ReplaceInPath&#10;hist&#9;ACTION&#9;Vcs.ShowTabbedFileHistory&#10;paste&#9;ACTION&#9;EditorPasteSimple&#10;rear &#9;ACTION&#9;RearrangeCode&#10;histor&#9;ACTION&#9;Vcs.ShowTabbedFileHistory&#10;rep in pa&#9;ACTION&#9;ReplaceInPath&#10;replace in&#9;ACTION&#9;ReplaceInPath&#10;rearr&#9;ACTION&#9;RearrangeCode&#10;rea&#9;ACTION&#9;RearrangeCode&#10;orde&#9;null&#9;null&#10;next hi&#9;ACTION&#9;GotoNextError&#10;next&#9;ACTION&#9;GotoNextError&#10;comm cha&#9;ACTION&#9;ChangesView.Commit&#10;comple&#9;ACTION&#9;CodeCompletionGroup&#10;complet&#9;ACTION&#9;CodeCompletionGroup&#10;sear&#9;ACTION&#9;SearchEverywhere&#10;breakpoint&#9;ACTION&#9;ToggleLineBreakpoint&#10;comm ch&#9;ACTION&#9;ChangesView.Commit&#10;smart&#9;ACTION&#9;SmartTypeCompletion&#10;para&#9;ACTION&#9;IntroduceParameter&#10;keyma&#9;ACTION&#9;ChangeKeymap&#10;commit&#9;ACTION&#9;Vcs.CheckCommitMessageSpelling&#10;commit &#9;ACTION&#9;Vcs.CheckCommitMessageSpelling&#10;phpunit&#9;null&#9;null&#10;exte&#9;ACTION&#9;EditorSelectWord&#10;composer&#9;ACTION&#9;ComposerGroup&#10;test&#9;ACTION&#9;RerunTests&#10;rer&#9;ACTION&#9;RerunTests&#10;tests&#9;ACTION&#9;RerunTests&#10;hpunit&#9;ACTION&#9;PhpUnitGenerateTestMethod&#10;phpuni&#9;ACTION&#9;PhpUnitNewTest&#10;rear&#9;ACTION&#9;RearrangeCode" />
<property name="SearchEverywhereHistoryKey" value="reform&#9;ACTION&#9;ReformatCode&#10;replace in pa&#9;ACTION&#9;ReplaceInPath&#10;hist&#9;ACTION&#9;Vcs.ShowTabbedFileHistory&#10;paste&#9;ACTION&#9;EditorPasteSimple&#10;rear &#9;ACTION&#9;RearrangeCode&#10;histor&#9;ACTION&#9;Vcs.ShowTabbedFileHistory&#10;rep in pa&#9;ACTION&#9;ReplaceInPath&#10;replace in&#9;ACTION&#9;ReplaceInPath&#10;rearr&#9;ACTION&#9;RearrangeCode&#10;rea&#9;ACTION&#9;RearrangeCode&#10;orde&#9;null&#9;null&#10;next hi&#9;ACTION&#9;GotoNextError&#10;next&#9;ACTION&#9;GotoNextError&#10;comm cha&#9;ACTION&#9;ChangesView.Commit&#10;comple&#9;ACTION&#9;CodeCompletionGroup&#10;complet&#9;ACTION&#9;CodeCompletionGroup&#10;sear&#9;ACTION&#9;SearchEverywhere&#10;breakpoint&#9;ACTION&#9;ToggleLineBreakpoint&#10;comm ch&#9;ACTION&#9;ChangesView.Commit&#10;smart&#9;ACTION&#9;SmartTypeCompletion&#10;para&#9;ACTION&#9;IntroduceParameter&#10;keyma&#9;ACTION&#9;ChangeKeymap&#10;commit&#9;ACTION&#9;Vcs.CheckCommitMessageSpelling&#10;commit &#9;ACTION&#9;Vcs.CheckCommitMessageSpelling&#10;phpunit&#9;null&#9;null&#10;exte&#9;ACTION&#9;EditorSelectWord&#10;composer&#9;ACTION&#9;ComposerGroup&#10;test&#9;ACTION&#9;RerunTests&#10;rer&#9;ACTION&#9;RerunTests&#10;tests&#9;ACTION&#9;RerunTests&#10;hpunit&#9;ACTION&#9;PhpUnitGenerateTestMethod&#10;phpuni&#9;ACTION&#9;PhpUnitNewTest&#10;rear&#9;ACTION&#9;RearrangeCode" />
<property name="settings.editor.selected.configurable" value="preferences.sourceCode.PHP" />
<property name="settings.editor.splitter.proportion" value="0.2" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../coffeetable_branch" />
@ -658,7 +729,13 @@
<option name="project" value="LOCAL" />
<updated>1458293744076</updated>
</task>
<option name="localTasksCounter" value="30" />
<task id="LOCAL-00030" summary="Rework Table constructor">
<created>1458293898715</created>
<option name="number" value="00030" />
<option name="project" value="LOCAL" />
<updated>1458293898715</updated>
</task>
<option name="localTasksCounter" value="31" />
<servers />
</component>
<component name="TestHistory">
@ -701,12 +778,13 @@
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32917705" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="12" side_tool="true" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3990025" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Command Line Tools Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3316583" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32917705" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32668328" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" x="0" y="355" width="1446" height="188" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.16875" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.23333333" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32917705" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32917705" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24964234" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3840399" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
@ -714,10 +792,31 @@
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="PHP-CGI Server" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Command Line Tools Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32917705" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
</layout>
<layout-to-restore>
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32917705" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="PHP-CGI Server" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="12" side_tool="true" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3990025" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Command Line Tools Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32917705" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32917705" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32668328" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" x="0" y="355" width="1446" height="188" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.16875" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32917705" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24964234" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3840399" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
</layout-to-restore>
</component>
<component name="UpdateCopyrightCheckinHandler">
<option name="UPDATE_COPYRIGHT" value="true" />
@ -735,7 +834,6 @@
</component>
<component name="VcsManagerConfiguration">
<option name="USE_COMMIT_MESSAGE_MARGIN" value="true" />
<MESSAGE value="Create Spot and SpotTest" />
<MESSAGE value="Refactor coordinates in Tile from X,Y to col,row" />
<MESSAGE value="Refactor Table.isValidFortile to couldContainTile" />
<MESSAGE value="Split Table and Map to the separate classes for decoupling" />
@ -760,7 +858,8 @@
<MESSAGE value="Implement Map.getNeighboursOfTile" />
<MESSAGE value="Rework Tile constructor" />
<MESSAGE value="BLA BLA BLA" />
<option name="LAST_COMMIT_MESSAGE" value="BLA BLA BLA" />
<MESSAGE value="Rework Table constructor" />
<option name="LAST_COMMIT_MESSAGE" value="Rework Table constructor" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="true" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" />
<option name="REARRANGE_BEFORE_PROJECT_COMMIT" value="true" />
@ -928,13 +1027,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/composer.json">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.14438502">
<caret line="6" column="13" selection-start-line="6" selection-start-column="13" selection-end-line="6" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file:///usr/share/nginx/html/coffeetable/src/Coffee/Map.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.47678572">
@ -1020,66 +1112,106 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Coffee/Tile.php">
<entry file="file://$PROJECT_DIR$/vendor/bin/phpunit">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-2.3703704">
<caret line="38" column="6" selection-start-line="38" selection-start-column="6" selection-end-line="38" selection-end-column="6" />
<state vertical-scroll-proportion="0.3901869">
<caret line="37" column="42" selection-start-line="37" selection-start-column="42" selection-end-line="37" selection-end-column="42" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Coffee/Spot.php">
<entry file="file://$PROJECT_DIR$/index.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-10.666667">
<caret line="39" column="7" selection-start-line="39" selection-start-column="7" selection-end-line="39" selection-end-column="7" />
<state vertical-scroll-proportion="-6.0">
<caret line="9" column="21" selection-start-line="9" selection-start-column="21" selection-end-line="9" selection-end-column="21" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Coffee/Position.php">
<entry file="file://$PROJECT_DIR$/composer.json">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-116.111115">
<caret line="175" column="23" selection-start-line="175" selection-start-column="23" selection-end-line="175" selection-end-column="23" />
<state vertical-scroll-proportion="0.29752067">
<caret line="8" column="5" selection-start-line="8" selection-start-column="5" selection-end-line="8" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Coffee/Table.php">
<entry file="file://$PROJECT_DIR$/tests/Coffee/PositionTest.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-23.333334">
<caret line="50" column="0" selection-start-line="50" selection-start-column="0" selection-end-line="50" selection-end-column="0" />
<state vertical-scroll-proportion="-18.660378">
<caret line="103" column="76" selection-start-line="103" selection-start-column="76" selection-end-line="103" selection-end-column="76" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/vendor/bin/phpunit">
<entry file="file://$PROJECT_DIR$/tests/Coffee/SpotTest.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.3901869">
<caret line="37" column="42" selection-start-line="37" selection-start-column="42" selection-end-line="37" selection-end-column="42" />
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/index.php">
<entry file="file://$PROJECT_DIR$/tests/Coffee/TableTest.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-6.0">
<caret line="9" column="21" selection-start-line="9" selection-start-column="21" selection-end-line="9" selection-end-column="21" />
<state vertical-scroll-proportion="-6.6666665">
<caret line="10" column="22" selection-start-line="10" selection-start-column="22" selection-end-line="10" selection-end-column="22" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/tests/Coffee/TileTest.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Coffee/Map.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-6.0">
<caret line="75" column="33" selection-start-line="75" selection-start-column="33" selection-end-line="75" selection-end-column="33" />
<state vertical-scroll-proportion="-7.3333335">
<caret line="35" column="7" selection-start-line="35" selection-start-column="7" selection-end-line="35" selection-end-column="7" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Coffee/Position.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-9.703704">
<caret line="175" column="23" selection-start-line="175" selection-start-column="23" selection-end-line="175" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Coffee/Spot.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-12.37037">
<caret line="39" column="7" selection-start-line="39" selection-start-column="7" selection-end-line="39" selection-end-column="7" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Coffee/Table.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-17.703703">
<caret line="68" column="0" selection-start-line="68" selection-start-column="0" selection-end-line="68" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Coffee/Tile.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-0.6666667">
<caret line="38" column="6" selection-start-line="38" selection-start-column="6" selection-end-line="38" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/tests/Coffee/MapTest.php">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.79752064">
<caret line="47" column="52" selection-start-line="47" selection-start-column="52" selection-end-line="47" selection-end-column="52" />
<state vertical-scroll-proportion="0.28877005">
<caret line="12" column="0" selection-start-line="12" selection-start-column="0" selection-end-line="12" selection-end-column="0" />
<folding />
</state>
</provider>

@ -1,6 +1,7 @@
{
"require-dev": {
"phpunit/phpunit": "5.2.*"
"phpunit/phpunit": "5.2.*",
"phpmd/phpmd": "@stable"
},
"autoload-dev": {
"psr-0": {

274
composer.lock generated

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "2886793b37f8ff226b298154be898209",
"content-hash": "5c48139016fec53f7c43de7c6ff8508d",
"hash": "835e1d546c82d631358062e62966525c",
"content-hash": "8c9ffcab7de4c22d081223c7d31ad609",
"packages": [],
"packages-dev": [
{
@ -104,6 +104,46 @@
],
"time": "2015-11-07 22:20:37"
},
{
"name": "pdepend/pdepend",
"version": "2.2.4",
"source": {
"type": "git",
"url": "https://github.com/pdepend/pdepend.git",
"reference": "b086687f3a01dc6bb92d633aef071d2c5dd0db06"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pdepend/pdepend/zipball/b086687f3a01dc6bb92d633aef071d2c5dd0db06",
"reference": "b086687f3a01dc6bb92d633aef071d2c5dd0db06",
"shasum": ""
},
"require": {
"php": ">=5.3.7",
"symfony/config": "^2.3.0|^3",
"symfony/dependency-injection": "^2.3.0|^3",
"symfony/filesystem": "^2.3.0|^3"
},
"require-dev": {
"phpunit/phpunit": "^4.4.0,<4.8",
"squizlabs/php_codesniffer": "^2.0.0"
},
"bin": [
"src/bin/pdepend"
],
"type": "library",
"autoload": {
"psr-4": {
"PDepend\\": "src/main/php/PDepend"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"description": "Official version of pdepend to be handled with Composer",
"time": "2016-03-10 15:15:04"
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "2.0.4",
@ -153,6 +193,71 @@
],
"time": "2015-02-03 12:10:50"
},
{
"name": "phpmd/phpmd",
"version": "2.4.2",
"source": {
"type": "git",
"url": "https://github.com/phpmd/phpmd.git",
"reference": "fccbdb6b222f6d7a6d35af1c396ba5435cec76a9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpmd/phpmd/zipball/fccbdb6b222f6d7a6d35af1c396ba5435cec76a9",
"reference": "fccbdb6b222f6d7a6d35af1c396ba5435cec76a9",
"shasum": ""
},
"require": {
"pdepend/pdepend": "~2.0",
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0",
"squizlabs/php_codesniffer": "^2.0"
},
"bin": [
"src/bin/phpmd"
],
"type": "project",
"autoload": {
"psr-0": {
"PHPMD\\": "src/main/php"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Manuel Pichler",
"email": "github@manuel-pichler.de",
"homepage": "https://github.com/manuelpichler",
"role": "Project Founder"
},
{
"name": "Other contributors",
"homepage": "https://github.com/phpmd/phpmd/graphs/contributors",
"role": "Contributors"
},
{
"name": "Marc Würth",
"email": "ravage@bluewin.ch",
"homepage": "https://github.com/ravage84",
"role": "Project Maintainer"
}
],
"description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.",
"homepage": "http://phpmd.org/",
"keywords": [
"mess detection",
"mess detector",
"pdepend",
"phpmd",
"pmd"
],
"time": "2016-03-10 17:17:44"
},
{
"name": "phpspec/prophecy",
"version": "v1.6.0",
@ -1052,6 +1157,167 @@
"homepage": "https://github.com/sebastianbergmann/version",
"time": "2016-02-04 12:56:52"
},
{
"name": "symfony/config",
"version": "v3.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
"reference": "79a97025f7bf4bbf8352b5df1905aa136a531066"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/config/zipball/79a97025f7bf4bbf8352b5df1905aa136a531066",
"reference": "79a97025f7bf4bbf8352b5df1905aa136a531066",
"shasum": ""
},
"require": {
"php": ">=5.5.9",
"symfony/filesystem": "~2.8|~3.0"
},
"suggest": {
"symfony/yaml": "To use the yaml reference dumper"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Config\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Config Component",
"homepage": "https://symfony.com",
"time": "2016-02-23 15:16:06"
},
{
"name": "symfony/dependency-injection",
"version": "v3.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
"reference": "821800ae6753b88dab55a7280811d8734b8112bf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/821800ae6753b88dab55a7280811d8734b8112bf",
"reference": "821800ae6753b88dab55a7280811d8734b8112bf",
"shasum": ""
},
"require": {
"php": ">=5.5.9"
},
"require-dev": {
"symfony/config": "~2.8|~3.0",
"symfony/expression-language": "~2.8|~3.0",
"symfony/yaml": "~2.8|~3.0"
},
"suggest": {
"symfony/config": "",
"symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
"symfony/yaml": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\DependencyInjection\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony DependencyInjection Component",
"homepage": "https://symfony.com",
"time": "2016-02-28 16:50:08"
},
{
"name": "symfony/filesystem",
"version": "v3.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "23ae8f9648d0a7fe94a47c8e20e5bf37c489a451"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/23ae8f9648d0a7fe94a47c8e20e5bf37c489a451",
"reference": "23ae8f9648d0a7fe94a47c8e20e5bf37c489a451",
"shasum": ""
},
"require": {
"php": ">=5.5.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Filesystem\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
"time": "2016-02-23 15:16:06"
},
{
"name": "symfony/yaml",
"version": "v3.0.3",
@ -1104,7 +1370,9 @@
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {
"phpmd/phpmd": 0
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],

@ -2,11 +2,11 @@
namespace Coffee;
/**
* Class Map
*
* @package Coffee
*/
/**
* Class Map
*
* @package Coffee
*/
/**
* Class Map
*
@ -14,137 +14,137 @@ namespace Coffee;
*/
class Map {
/**
* @var Tile[]
*/
private $tiles = [];
/**
* @var int
*/
private $height = 0;
/**
* @var int
*/
private $width = 0;
/**
* Map constructor.
*
* @param $description [][]
* @throws \Exception
*/
public function __construct($description) {
// The description must be 2D array containing at least one element
if (is_null($description) || !is_array($description) || !is_array($description[0]) || count($description[0]) < 1) {
throw new \Exception('The Coffee Table map could not be loaded.');
}
$height = 0;
$width = 0;
// This data processing could be written more read-ably in multiple cycles / private methods,
// but at a cost of reduced performance (minor).
foreach ($description as $rowIndex => $row) {
foreach ($row as $columnIndex => $tileRepresentation) {
// W need to convert indices to positions
$this->tiles[] = new Tile($rowIndex + 1, $columnIndex + 1, $tileRepresentation);
// Find maximum
$width = $columnIndex > $width ? $columnIndex : $width;
}
// Find maximum
$height = $rowIndex > $height ? $rowIndex : $height;
}
// Convert indices to dimensions
$this->height = $height + 1;
$this->width = $width + 1;
}
/**
* @return Tile[]
*/
public function getTiles() {
return $this->tiles;
}
/**
* @return Tile[]
*/
public function getUnvisitedTiles() {
$array = [];
foreach ($this->getTiles() as $tile) {
if (!$tile->isVisited()) {
$array[] = $tile;
}
}
return $array;
}
public function getUnvisitedTile() {
foreach ($this->getTiles() as $tile) {
if (!$tile->isVisited()) {
return $tile;
}
}
return false;
}
/**
* @param Position $position
* @return Tile|null
*/
public function getTileByPosition(Position $position) {
foreach ($this->getTiles() as $tile) {
if ($tile->isTheSamePosition($position)) {
return $tile;
}
}
return null;
}
/**
* @return array
*/
public function describedByArray() {
$array = [];
foreach ($this->getTiles() as $tile) {
$array[$tile->getRowIndex()][$tile->getColumnIndex()] = $tile->isRepresentingSpot();
}
return $array;
}
/**
* @param Tile $tile
* @return Tile[]
*/
public function getNeighboursOfTile(Tile $tile) {
$neighbouringTiles = [];
foreach ($tile->getNeighbouringPositions() as $neighbouringPosition) {
$neighbouringTiles[] = $this->getTileByPosition($neighbouringPosition);
}
return array_values(array_filter($neighbouringTiles));
}
/**
* @return int
*/
public function getHeight() {
return $this->height;
}
/**
* @return int
*/
public function getWidth() {
return $this->width;
}
/**
* @var Tile[]
*/
private $tiles = [];
/**
* @var int
*/
private $height = 0;
/**
* @var int
*/
private $width = 0;
/**
* Map constructor.
*
* @param $description [][]
* @throws \Exception
*/
public function __construct($description) {
// The description must be 2D array containing at least one element
if (is_null($description) || !is_array($description) || !is_array($description[0]) || count($description[0]) < 1) {
throw new \Exception('The Coffee Table map could not be loaded.');
}
$height = 0;
$width = 0;
// This data processing could be written more read-ably in multiple cycles / private methods,
// but at a cost of reduced performance (minor).
foreach ($description as $rowIndex => $row) {
foreach ($row as $columnIndex => $tileRepresentation) {
// W need to convert indices to positions
$this->tiles[] = new Tile($rowIndex + 1, $columnIndex + 1, $tileRepresentation);
// Find maximum
$width = $columnIndex > $width ? $columnIndex : $width;
}
// Find maximum
$height = $rowIndex > $height ? $rowIndex : $height;
}
// Convert indices to dimensions
$this->height = $height + 1;
$this->width = $width + 1;
}
/**
* @return Tile[]
*/
public function getTiles() {
return $this->tiles;
}
/**
* @return Tile[]
*/
public function getUnvisitedTiles() {
$array = [];
foreach ($this->getTiles() as $tile) {
if (!$tile->isVisited()) {
$array[] = $tile;
}
}
return $array;
}
public function getUnvisitedTile() {
foreach ($this->getTiles() as $tile) {
if (!$tile->isVisited()) {
return $tile;
}
}
return false;
}
/**
* @param Position $position
* @return Tile|null
*/
public function getTileByPosition(Position $position) {
foreach ($this->getTiles() as $tile) {
if ($tile->isTheSamePosition($position)) {
return $tile;
}
}
return null;
}
/**
* @return array
*/
public function describedByArray() {
$array = [];
foreach ($this->getTiles() as $tile) {
$array[$tile->getRowIndex()][$tile->getColumnIndex()] = $tile->isRepresentingSpot();
}
return $array;
}
/**
* @param Tile $tile
* @return Tile[]
*/
public function getNeighboursOfTile(Tile $tile) {
$neighbouringTiles = [];
foreach ($tile->getNeighbouringPositions() as $neighbouringPosition) {
$neighbouringTiles[] = $this->getTileByPosition($neighbouringPosition);
}
return array_values(array_filter($neighbouringTiles));
}
/**
* @return int
*/
public function getHeight() {
return $this->height;
}
/**
* @return int
*/
public function getWidth() {
return $this->width;
}
//
// /**
// * @param Position $position

@ -2,11 +2,11 @@
namespace Coffee;
/**
* Class Position
*
* @package Coffee
*/
/**
* Class Position
*
* @package Coffee
*/
/**
* Class Position
*
@ -14,184 +14,184 @@ namespace Coffee;
*/
class Position {
/**
* The lowest possible position for rows and columns
*/
const LOWER_BOUND = 1;
/**
* @var int
*/
private $column = 0;
/**
* @var int
*/
private $row = 0;
/**
* @param $row
* @param $column
* @throws \Exception
*/
function __construct($row, $column) {
if (!$this->fitsIntoLowerBound($row, $column)) {
throw new \Exception('The row argument must be higher than ' . self::LOWER_BOUND . '.');
}
$this->column = $column;
$this->row = $row;
}
/**
* @return int
*/
public function getColumn() {
return $this->column;
}
/**
* @return int
*/
public function getColumnIndex() {
return $this->column - 1;
}
/**
* @return int
*/
public function getRow() {
return $this->row;
}
/**
* @return int
*/
public function getRowIndex() {
return $this->row - 1;
}
/**
* @param Position $position
* @return bool
*/
public function isTheSameColumn(Position $position) {
return $this->getColumn() == $position->getColumn();
}
/**
* @param Position $position
* @return bool
*/
public function isTheSameRow(Position $position) {
return $this->getRow() == $position->getRow();
}
/**
* @param Position $position
* @return bool
*/
public function isTheSamePosition(Position $position) {
return $this->isTheSameColumn($position) && $this->isTheSameRow($position);
}
/**
* @return Position
*/
public function getNorthEastPosition() {
return $this->getSafeNeighbourPosition($this->getRow() - 1, $this->getColumn() + 1);
}
/**
* @return Position
*/
public function getEastPosition() {
return $this->getSafeNeighbourPosition($this->getRow(), $this->getColumn() + 1);
}
/**
* @return Position
*/
public function getSouthEastPosition() {
return $this->getSafeNeighbourPosition($this->getRow() + 1, $this->getColumn() + 1);
}
/**
* @return Position
*/
public function getSouthPosition() {
return $this->getSafeNeighbourPosition($this->getRow() + 1, $this->getColumn());
}
/**
* @return Position
*/
public function getSouthWestPosition() {
return $this->getSafeNeighbourPosition($this->getRow() + 1, $this->getColumn() - 1);
}
/**
* @return Position
*/
public function getWestPosition() {
return $this->getSafeNeighbourPosition($this->getRow(), $this->getColumn() - 1);
}
/**
* @return Position
*/
public function getNorthWestPosition() {
return $this->getSafeNeighbourPosition($this->getRow() - 1, $this->getColumn() - 1);
}
/**
* @return Position
*/
public function getNorthPosition() {
return $this->getSafeNeighbourPosition($this->getRow() - 1, $this->getColumn());
}
/**
* @return array Positions of neighbours from NE to N; CW direction
*/
public function getNeighbouringPositions() {
// null values from out-of-lower-bound neighbours are filtered out and indices are fixed
return array_values(array_filter([
$this->getNorthEastPosition(),
$this->getEastPosition(),
$this->getSouthEastPosition(),
$this->getSouthPosition(),
$this->getSouthWestPosition(),
$this->getWestPosition(),
$this->getNorthWestPosition(),
$this->getNorthPosition(),
]));
}
/**
* @param $row
* @param $column
* @return bool
*/
protected function fitsIntoLowerBound($row, $column) {
if ($row < self::LOWER_BOUND || $column < self::LOWER_BOUND) {
return false;
}
return true;
}
/**
* @param $row
* @param $column
* @return Position|null
*/
protected function getSafeNeighbourPosition($row, $column) {
if ($this->fitsIntoLowerBound($row, $column)) {
return new Position($row, $column);
}
return null;
}
/**
* The lowest possible position for rows and columns
*/
const LOWER_BOUND = 1;
/**
* @var int
*/
private $column = 0;
/**
* @var int
*/
private $row = 0;
/**
* @param $row
* @param $column
* @throws \Exception
*/
function __construct($row, $column) {
if (!$this->fitsIntoLowerBound($row, $column)) {
throw new \Exception('The row argument must be higher than ' . self::LOWER_BOUND . '.');
}
$this->column = $column;
$this->row = $row;
}
/**
* @return int
*/
public function getColumn() {
return $this->column;
}
/**
* @return int
*/
public function getColumnIndex() {
return $this->column - 1;
}
/**
* @return int
*/
public function getRow() {
return $this->row;
}
/**
* @return int
*/
public function getRowIndex() {
return $this->row - 1;
}
/**
* @param Position $position
* @return bool
*/
public function isTheSameColumn(Position $position) {
return $this->getColumn() == $position->getColumn();
}
/**
* @param Position $position
* @return bool
*/
public function isTheSameRow(Position $position) {
return $this->getRow() == $position->getRow();
}
/**
* @param Position $position
* @return bool
*/
public function isTheSamePosition(Position $position) {
return $this->isTheSameColumn($position) && $this->isTheSameRow($position);
}
/**
* @return Position
*/
public function getNorthEastPosition() {
return $this->getSafeNeighbourPosition($this->getRow() - 1, $this->getColumn() + 1);
}
/**
* @return Position
*/
public function getEastPosition() {
return $this->getSafeNeighbourPosition($this->getRow(), $this->getColumn() + 1);
}
/**
* @return Position
*/
public function getSouthEastPosition() {
return $this->getSafeNeighbourPosition($this->getRow() + 1, $this->getColumn() + 1);
}
/**
* @return Position
*/
public function getSouthPosition() {
return $this->getSafeNeighbourPosition($this->getRow() + 1, $this->getColumn());
}
/**
* @return Position
*/
public function getSouthWestPosition() {
return $this->getSafeNeighbourPosition($this->getRow() + 1, $this->getColumn() - 1);
}
/**
* @return Position
*/
public function getWestPosition() {
return $this->getSafeNeighbourPosition($this->getRow(), $this->getColumn() - 1);
}
/**
* @return Position
*/
public function getNorthWestPosition() {
return $this->getSafeNeighbourPosition($this->getRow() - 1, $this->getColumn() - 1);
}
/**
* @return Position
*/
public function getNorthPosition() {
return $this->getSafeNeighbourPosition($this->getRow() - 1, $this->getColumn());
}
/**
* @return array Positions of neighbours from NE to N; CW direction
*/
public function getNeighbouringPositions() {
// null values from out-of-lower-bound neighbours are filtered out and indices are fixed
return array_values(array_filter([
$this->getNorthEastPosition(),
$this->getEastPosition(),
$this->getSouthEastPosition(),
$this->getSouthPosition(),
$this->getSouthWestPosition(),
$this->getWestPosition(),
$this->getNorthWestPosition(),
$this->getNorthPosition(),
]));
}
/**
* @param $row
* @param $column
* @return bool
*/
protected function fitsIntoLowerBound($row, $column) {
if ($row < self::LOWER_BOUND || $column < self::LOWER_BOUND) {
return false;
}
return true;
}
/**
* @param $row
* @param $column
* @return Position|null
*/
protected function getSafeNeighbourPosition($row, $column) {
if ($this->fitsIntoLowerBound($row, $column)) {
return new Position($row, $column);
}
return null;
}
}

@ -8,11 +8,11 @@
namespace Coffee;
/**
* Class Spot
*
* @package Coffee
*/
/**
* Class Spot
*
* @package Coffee
*/
/**
* Class Spot
*
@ -20,38 +20,38 @@ namespace Coffee;
*/
class Spot {
/**
* @var Position[]
*/
private $positions = [];
/**
* Spot constructor.
*
* @param Position $position
*/
public function __construct(Position $position) {
$this->positions[] = $position;
}
/**
* @param Position $position
* @return bool
*/
public function addPosition(Position $position) {
if (is_null($position)) {
return false;
}
$this->positions[] = $position;
return true;
}
/**
* @return Position[]
*/
public function getPositions() {
return $this->positions;
}
/**
* @var Position[]
*/
private $positions = [];
/**
* Spot constructor.
*
* @param Position $position
*/
public function __construct(Position $position) {
$this->positions[] = $position;
}
/**
* @param Position $position
* @return bool
*/
public function addPosition(Position $position) {
if (is_null($position)) {
return false;
}
$this->positions[] = $position;
return true;
}
/**
* @return Position[]
*/
public function getPositions() {
return $this->positions;
}
}

@ -14,65 +14,65 @@ namespace Coffee;
*/
class Table {
/**
* @var Spot[]
*/
private $spots = [];
/**
* @var Spot[]
*/
private $spots = [];
/**
* Table constructor.
*
* @param Map $map
*/
public function __construct(Map $map) {
foreach ($map->getTiles() as $currentTile) {
/**
* Table constructor.
*
* @param Map $map
*/
public function __construct(Map $map) {
foreach ($map->getTiles() as $currentTile) {
if (!$currentTile->isVisited()) {
$currentTile->visit();
if (!$currentTile->isVisited()) {
$currentTile->visit();
if ($currentTile->isRepresentingSpot()) {
$spot = new Spot($currentTile->getPosition());
if ($currentTile->isRepresentingSpot()) {
$spot = new Spot($currentTile->getPosition());
foreach ($map->getNeighboursOfTile($currentTile) as $neighbouringTile) {
$neighbouringTile->visit();
foreach ($map->getNeighboursOfTile($currentTile) as $neighbouringTile) {
$neighbouringTile->visit();
if ($neighbouringTile->isRepresentingSpot()) {
$spot->addPosition($neighbouringTile->getPosition());
}
}
if ($neighbouringTile->isRepresentingSpot()) {
$spot->addPosition($neighbouringTile->getPosition());
}
}
$this->addSpot($spot);
}
}
$this->addSpot($spot);
}
}
}
}
}
}
/**
* @return Spot[]
*/
public function getSpots() {
return $this->spots;
}
/**
* @return Spot[]
*/
public function getSpots() {
return $this->spots;
}
/**
* @return int
*/
public function getSpotsCount() {
return count($this->spots);
}
/**
* @return int
*/
public function getSpotsCount() {
return count($this->spots);
}
/**
* @param Spot $spot
* @return bool
*/
protected function addSpot(Spot $spot) {
if (is_null($spot)) {
return false;
}
/**
* @param Spot $spot
* @return bool
*/
protected function addSpot(Spot $spot) {
if (is_null($spot)) {
return false;
}
$this->spots[] = $spot;
return true;
}
$this->spots[] = $spot;
return true;
}
}

@ -14,83 +14,84 @@ namespace Coffee;
*/
class Tile extends Position {
/**
* Representation on the map, that element exists on the given tile
*/
const REPRESENTS_SPOT = 1;
/**
* Representation on the map, that element does not exist on the given tile
*/
const REPRESENTS_VOID = 0;
/**
* @var integer
*/
private $representation;
/**
* Representation on the map, that element exists on the given tile
*/
const REPRESENTS_SPOT = 1;
/**
* Representation on the map, that element does not exist on the given tile
*/
const REPRESENTS_VOID = 0;
/**
* @var integer
*/
private $representation;
/**
* Tiles are inherently unvisited
*
*@var bool
*/
private $visited = false;
/**
* Tiles are inherently unvisited
*
* @var bool
*/
private $visited = false;
/**
* Tile constructor.
*
* @param $row
* @param $column
* @param $tileRepresentation
* @throws \Exception
*/
public function __construct($row, $column, $tileRepresentation) {
if (!$this->isRepresentingSpot() && !$this->isRepresentingVoid()) {
throw new \Exception('The map contains invalid representations');
}
/**
* Tile constructor.
*
* @param $row
* @param $column
* @param $tileRepresentation
* @throws \Exception
*/
public function __construct($row, $column, $tileRepresentation) {
if (!$this->isRepresentingSpot() && !$this->isRepresentingVoid()) {
throw new \Exception('The map contains invalid representations');
}
parent::__construct($row, $column);
parent::__construct($row, $column);
$this->representation = $tileRepresentation;
}
$this->representation = $tileRepresentation;
}
/**
* @return boolean
*/
public function isVisited() {
return $this->visited;
}
/**
* @return boolean
*/
public function isVisited() {
return $this->visited;
}
/**
* Flags this Tile as "visited"
*
* @return bool
*/
public function visit() {
if ($this->isVisited())
return false;
/**
* Flags this Tile as "visited"
*
* @return bool
*/
public function visit() {
if ($this->isVisited()) {
return false;
}
$this->visited = true;
return true;
}
$this->visited = true;
return true;
}
/**
* @return boolean
*/
public function isRepresentingSpot() {
return $this->representation == self::REPRESENTS_SPOT;
}
/**
* @return boolean
*/
public function isRepresentingSpot() {
return $this->representation == self::REPRESENTS_SPOT;
}
/**
* @return bool
*/
public function isRepresentingVoid() {
return $this->representation == self::REPRESENTS_VOID;
}
/**
* @return bool
*/
public function isRepresentingVoid() {
return $this->representation == self::REPRESENTS_VOID;
}
/**
* @return Position
*/
public function getPosition() {
return new Position($this->getRow(), $this->getColumn());
}
/**
* @return Position
*/
public function getPosition() {
return new Position($this->getRow(), $this->getColumn());
}
}

@ -7,119 +7,119 @@ require __DIR__ . '/../../vendor/autoload.php';
class MapTest extends \PHPUnit_Framework_TestCase {
public function testGetTiles() {
$tileA = new Tile(1, 1, Tile::REPRESENTS_SPOT);
$tileB = new Tile(1, 2, Tile::REPRESENTS_VOID);
$map = new Map([[1, 0]]);
$this->assertEquals([$tileA, $tileB], $map->getTiles());
}
public function testUnvisitedTile() {
$description = [
[1, 0],
[0, 1],
];
$map = new Map($description);
$tiles = $map->getTiles();
$tiles[0]->visit();
$tiles[3]->visit();
$tile = new Tile(1, 2, Tile::REPRESENTS_VOID);
$this->assertEquals($tile, $map->getUnvisitedTile());
}
public function testUnVisitedTiles() {
$description = [
[1, 0],
[0, 1],
];
$map = new Map($description);
$tiles = $map->getTiles();
$tiles[2]->visit();
$tiles[3]->visit();
$tileA = new Tile(1, 1, Tile::REPRESENTS_SPOT);
$tileB = new Tile(1, 2, Tile::REPRESENTS_VOID);
$this->assertEquals([$tileA, $tileB], $map->getUnvisitedTiles());
}
public function testDescribedByArray() {
$description = [
[1, 0],
[0, 1],
];
$map = new Map($description);
$this->assertEquals($description, $map->describedByArray());
}
public function testTileByPosition() {
$description = [
[1, 0],
[0, 1],
];
$map = new Map($description);
$row = 1;
$column = 1;
$position = new Position($row, $column);
$tile = new Tile($row, $column, Tile::REPRESENTS_SPOT);
$this->assertEquals($tile, $map->getTileByPosition($position));
}
public function testHeight() {
$description = [
[0, 1, 0, 1],
[1, 0, 0, 0],
[0, 0, 0, 1],
[0, 0, 0, 1]
];
$map = new Map($description);
$this->assertEquals(4, $map->getHeight());
}
public function testWidth() {
$description = [
[0, 1, 0, 1],
[1, 0, 0, 0],
[0, 0, 0, 1],
[0, 0, 0, 1]
];
$map = new Map($description);
$this->assertEquals(4, $map->getWidth());
}
public function testNeighboursOfTile() {
$description = [
[0, 1, 0, 1],
[1, 0, 0, 0],
[0, 0, 0, 1],
[0, 0, 0, 1]
];
$map = new Map($description);
$position = new Position(4, 4);
$tile = $map->getTileByPosition($position);
$neighbours = [
new Tile(4, 3, Tile::REPRESENTS_VOID),
new Tile(3, 3, Tile::REPRESENTS_VOID),
new Tile(3, 4, Tile::REPRESENTS_SPOT),
];
$this->assertEquals($neighbours, $map->getNeighboursOfTile($tile));
}
public function testGetTiles() {
$tileA = new Tile(1, 1, Tile::REPRESENTS_SPOT);
$tileB = new Tile(1, 2, Tile::REPRESENTS_VOID);
$map = new Map([[1, 0]]);
$this->assertEquals([$tileA, $tileB], $map->getTiles());
}
public function testUnvisitedTile() {
$description = [
[1, 0],
[0, 1],
];
$map = new Map($description);
$tiles = $map->getTiles();
$tiles[0]->visit();
$tiles[3]->visit();
$tile = new Tile(1, 2, Tile::REPRESENTS_VOID);
$this->assertEquals($tile, $map->getUnvisitedTile());
}
public function testUnVisitedTiles() {
$description = [
[1, 0],
[0, 1],
];
$map = new Map($description);
$tiles = $map->getTiles();
$tiles[2]->visit();
$tiles[3]->visit();
$tileA = new Tile(1, 1, Tile::REPRESENTS_SPOT);
$tileB = new Tile(1, 2, Tile::REPRESENTS_VOID);
$this->assertEquals([$tileA, $tileB], $map->getUnvisitedTiles());
}
public function testDescribedByArray() {
$description = [
[1, 0],
[0, 1],
];
$map = new Map($description);
$this->assertEquals($description, $map->describedByArray());
}
public function testTileByPosition() {
$description = [
[1, 0],
[0, 1],
];
$map = new Map($description);
$row = 1;
$column = 1;
$position = new Position($row, $column);
$tile = new Tile($row, $column, Tile::REPRESENTS_SPOT);
$this->assertEquals($tile, $map->getTileByPosition($position));
}
public function testHeight() {
$description = [
[0, 1, 0, 1],
[1, 0, 0, 0],
[0, 0, 0, 1],
[0, 0, 0, 1]
];
$map = new Map($description);
$this->assertEquals(4, $map->getHeight());
}
public function testWidth() {
$description = [
[0, 1, 0, 1],
[1, 0, 0, 0],
[0, 0, 0, 1],
[0, 0, 0, 1]
];
$map = new Map($description);
$this->assertEquals(4, $map->getWidth());
}
public function testNeighboursOfTile() {
$description = [
[0, 1, 0, 1],
[1, 0, 0, 0],
[0, 0, 0, 1],
[0, 0, 0, 1]
];
$map = new Map($description);
$position = new Position(4, 4);
$tile = $map->getTileByPosition($position);
$neighbours = [
new Tile(4, 3, Tile::REPRESENTS_VOID),
new Tile(3, 3, Tile::REPRESENTS_VOID),
new Tile(3, 4, Tile::REPRESENTS_SPOT),
];
$this->assertEquals($neighbours, $map->getNeighboursOfTile($tile));
}
// public function testValidPosition() {
// $description = [

@ -51,57 +51,57 @@ class PositionTest extends \PHPUnit_Framework_TestCase {
public function testEastPosition() {
$position = new Position(2, 2);
$northPositionA = $position->getEastPosition();
$NorthPositionB = new Position(2, 3);
$northPositionB = new Position(2, 3);
$this->assertTrue($northPositionA->isTheSamePosition($NorthPositionB));
$this->assertTrue($northPositionA->isTheSamePosition($northPositionB));
}
public function testSouthEastPosition() {
$position = new Position(2, 2);
$northPositionA = $position->getSouthEastPosition();
$NorthPositionB = new Position(3, 3);
$northPositionB = new Position(3, 3);
$this->assertTrue($northPositionA->isTheSamePosition($NorthPositionB));
$this->assertTrue($northPositionA->isTheSamePosition($northPositionB));
}
public function testSouthPosition() {
$position = new Position(2, 2);
$northPositionA = $position->getSouthPosition();
$NorthPositionB = new Position(3, 2);
$northPositionB = new Position(3, 2);
$this->assertTrue($northPositionA->isTheSamePosition($NorthPositionB));
$this->assertTrue($northPositionA->isTheSamePosition($northPositionB));
}
public function testsSouthWestPosition() {
$position = new Position(2, 2);
$northPositionA = $position->getSouthWestPosition();
$NorthPositionB = new Position(3, 1);
$northPositionB = new Position(3, 1);
$this->assertTrue($northPositionA->isTheSamePosition($NorthPositionB));
$this->assertTrue($northPositionA->isTheSamePosition($northPositionB));
}
public function testWestPosition() {
$position = new Position(2, 2);
$northPositionA = $position->getWestPosition();
$NorthPositionB = new Position(2, 1);
$northPositionB = new Position(2, 1);
$this->assertTrue($northPositionA->isTheSamePosition($NorthPositionB));
$this->assertTrue($northPositionA->isTheSamePosition($northPositionB));
}
public function testNorthWestPosition() {
$position = new Position(2, 2);
$northPositionA = $position->getNorthWestPosition();
$NorthPositionB = new Position(1, 1);
$northPositionB = new Position(1, 1);
$this->assertTrue($northPositionA->isTheSamePosition($NorthPositionB));
$this->assertTrue($northPositionA->isTheSamePosition($northPositionB));
}
public function testNorthPosition() {
$position = new Position(2, 2);
$northPositionA = $position->getNorthPosition();
$NorthPositionB = new Position(1, 2);
$northPositionB = new Position(1, 2);
$this->assertTrue($northPositionA->isTheSamePosition($NorthPositionB));
$this->assertTrue($northPositionA->isTheSamePosition($northPositionB));
}
public function testOpenSpaceNeighbours() {

@ -7,10 +7,10 @@ require __DIR__ . '/../../vendor/autoload.php';
class SpotTest extends \PHPUnit_Framework_TestCase {
public function testGetPositions() {
$position = new Position(2, 1);
$spot = new Spot($position);
public function testGetPositions() {
$position = new Position(2, 1);
$spot = new Spot($position);
$this->assertEquals([$position], $spot->getPositions());
}
$this->assertEquals([$position], $spot->getPositions());
}
}

@ -14,31 +14,30 @@ class TableTest extends \PHPUnit_Framework_TestCase {
// $this->assertEquals([$spot], $table->getSpots());
// }
public function testZeroSpotsCount() {
$description = [
[0, 0],
[0, 0],
];
$map = new Map($description);
$table = new Table($map);
$this->assertEquals(0, $table->getSpotsCount());
}
public function testTwoSingleSpotsCount() {
$description = [
[0, 1, 0],
[0, 0, 0],
[1, 0, 0],
[0, 0, 0],
];
$map = new Map($description);
$table = new Table($map);
$this->assertEquals(2, $table->getSpotsCount());
}
public function testZeroSpotsCount() {
$description = [
[0, 0],
[0, 0],
];
$map = new Map($description);
$table = new Table($map);
$this->assertEquals(0, $table->getSpotsCount());
}
public function testTwoSingleSpotsCount() {
$description = [
[0, 1, 0],
[0, 0, 0],
[1, 0, 0],
[0, 0, 0],
];
$map = new Map($description);
$table = new Table($map);
$this->assertEquals(2, $table->getSpotsCount());
}
}

@ -7,34 +7,34 @@ require __DIR__ . '/../../vendor/autoload.php';
class TileTest extends \PHPUnit_Framework_TestCase {
public function testRepresentingSpot() {
$tile = new Tile(2, 2, Tile::REPRESENTS_SPOT);
public function testRepresentingSpot() {
$tile = new Tile(2, 2, Tile::REPRESENTS_SPOT);
$this->assertTrue($tile->isRepresentingSpot());
}
$this->assertTrue($tile->isRepresentingSpot());
}
public function testRepresentingVoid() {
$tile = new Tile(2, 2, Tile::REPRESENTS_VOID);
public function testRepresentingVoid() {
$tile = new Tile(2, 2, Tile::REPRESENTS_VOID);
$this->assertTrue($tile->isRepresentingVoid());
}
$this->assertTrue($tile->isRepresentingVoid());
}
public function testGetPosition() {
$row = 2;
$column = 2;
public function testGetPosition() {
$row = 2;
$column = 2;
$tile = new Tile($row, $column, Tile::REPRESENTS_VOID);
$position = new Position($row, $column);
$tile = new Tile($row, $column, Tile::REPRESENTS_VOID);
$position = new Position($row, $column);
$this->assertEquals($position, $tile->getPosition());
$this->assertEquals($position, $tile->getPosition());
}
}
public function testIsVisited() {
$tile = new Tile(2, 2, Tile::REPRESENTS_SPOT);
$tile->visit();
public function testIsVisited() {
$tile = new Tile(2, 2, Tile::REPRESENTS_SPOT);
$tile->visit();
$this->assertTrue($tile->isVisited());
}
$this->assertTrue($tile->isVisited());
}
}

Loading…
Cancel
Save