Skip to content

Commit

Permalink
PHPCS fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmatosbc committed Dec 2, 2024
1 parent 2101f35 commit 85dbc1f
Show file tree
Hide file tree
Showing 9 changed files with 136 additions and 136 deletions.
2 changes: 1 addition & 1 deletion src/ContainerArrayObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ContainerArrayObject extends EnhancedArrayObject implements ContainerInter

/**
* Constructor
*
*
* @param array $definitions Initial container definitions
*/
public function __construct(array $definitions = [])
Expand Down
30 changes: 15 additions & 15 deletions src/Dictionary.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

/**
* Dictionary implementation with Iterator, Countable, and Serializable interfaces
*
*
* Provides a key-value collection with standard dictionary operations and iteration capabilities.
*
*
* @package Daedalus
*/
class Dictionary implements Iterator, Countable, Serializable
Expand All @@ -24,7 +24,7 @@ class Dictionary implements Iterator, Countable, Serializable

/**
* Adds a key-value pair to the dictionary
*
*
* @param mixed $key The key to add
* @param mixed $value The value to associate with the key
* @throws Exception If the key already exists
Expand All @@ -39,7 +39,7 @@ public function add($key, $value)

/**
* Gets a value by its key
*
*
* @param mixed $key The key to look up
* @return mixed The value associated with the key
* @throws Exception If the key doesn't exist
Expand All @@ -54,7 +54,7 @@ public function get($key)

/**
* Removes a key-value pair from the dictionary
*
*
* @param mixed $key The key to remove
* @throws Exception If the key doesn't exist
*/
Expand All @@ -68,7 +68,7 @@ public function remove($key)

/**
* Updates a value for an existing key
*
*
* @param mixed $key The key to update
* @param mixed $value The new value
* @throws Exception If the key doesn't exist
Expand All @@ -83,7 +83,7 @@ public function update($key, $value)

/**
* Checks if a key exists in the dictionary
*
*
* @param mixed $key The key to check
* @return bool True if the key exists, false otherwise
*/
Expand All @@ -94,7 +94,7 @@ public function containsKey($key): bool

/**
* Gets all keys in the dictionary
*
*
* @return array List of all keys
*/
public function keys(): ?array
Expand All @@ -104,7 +104,7 @@ public function keys(): ?array

/**
* Gets all values in the dictionary
*
*
* @return array List of all values
*/
public function values(): ?array
Expand All @@ -122,7 +122,7 @@ public function clear(): void

/**
* Gets the current value during iteration
*
*
* @return mixed The current value
*/
public function current()
Expand All @@ -132,7 +132,7 @@ public function current()

/**
* Gets the current key during iteration
*
*
* @return mixed The current key
*/
public function key()
Expand All @@ -158,7 +158,7 @@ public function rewind(): void

/**
* Checks if the current position is valid
*
*
* @return bool True if the position is valid, false otherwise
*/
public function valid(): bool
Expand All @@ -168,7 +168,7 @@ public function valid(): bool

/**
* Gets the count of items in the dictionary
*
*
* @return int The number of items
*/
public function count(): int
Expand All @@ -178,7 +178,7 @@ public function count(): int

/**
* Serializes the dictionary to a string
*
*
* @return string The serialized dictionary
*/
public function serialize(): string
Expand All @@ -188,7 +188,7 @@ public function serialize(): string

/**
* Unserializes a string back into a dictionary
*
*
* @param string $data The serialized dictionary data
*/
public function unserialize(string $data)
Expand Down
24 changes: 12 additions & 12 deletions src/DisjointSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

/**
* DisjointSet implementation that extends Set with Union-Find operations
*
*
* Provides efficient operations for maintaining disjoint (non-overlapping) sets
* with union by rank and path compression optimizations.
*
*
* @package Daedalus
*/
class DisjointSet extends Set
Expand All @@ -20,7 +20,7 @@ class DisjointSet extends Set

/**
* Constructor
*
*
* @param array $items Initial items for the disjoint sets
*/
public function __construct(array $items = [])
Expand All @@ -33,7 +33,7 @@ public function __construct(array $items = [])

/**
* Creates a new set containing only the specified item
*
*
* @param mixed $item The item to create a set for
* @return bool True if the set was created, false if item already exists
*/
Expand All @@ -55,10 +55,10 @@ public function makeSet(mixed $item): bool

/**
* Finds the representative element of the set containing the item
*
*
* Implements path compression: all nodes along the path to the root
* are made to point directly to the root.
*
*
* @param mixed $item The item to find the representative for
* @return mixed|null The representative item, or null if item doesn't exist
*/
Expand All @@ -79,10 +79,10 @@ public function find(mixed $item): mixed

/**
* Merges the sets containing the two items
*
*
* Implements union by rank: the root with higher rank becomes the parent.
* If ranks are equal, the second root becomes parent and its rank increases.
*
*
* @param mixed $item1 First item
* @param mixed $item2 Second item
* @return bool True if sets were merged, false if items don't exist or are already in same set
Expand Down Expand Up @@ -111,7 +111,7 @@ public function union(mixed $item1, mixed $item2): bool

/**
* Checks if two items are in the same set
*
*
* @param mixed $item1 First item
* @param mixed $item2 Second item
* @return bool True if items are in the same set, false otherwise
Expand All @@ -126,7 +126,7 @@ public function connected(mixed $item1, mixed $item2): bool

/**
* Gets all items in the same set as the given item
*
*
* @param mixed $item The item to get the set for
* @return array Array of items in the same set
*/
Expand All @@ -150,7 +150,7 @@ public function getSet(mixed $item): array

/**
* Gets the number of disjoint sets
*
*
* @return int Number of disjoint sets
*/
public function countSets(): int
Expand All @@ -176,7 +176,7 @@ public function clear(): void

/**
* Gets an item by its hash
*
*
* @param string $hash The hash to look up
* @return mixed The item with the given hash
*/
Expand Down
Loading

0 comments on commit 85dbc1f

Please sign in to comment.