Code Duplication    Length = 3-3 lines in 2 locations

projects/packages/changelogger/src/AddCommand.php 1 location

@@ 119-121 (lines=3) @@
116
		}
117
		if ( $bad ) {
118
			$bad = array_keys( $bad );
119
			if ( count( $bad ) > 1 ) {
120
				$bad[ count( $bad ) - 1 ] = 'or ' . $bad[ count( $bad ) - 1 ];
121
			}
122
			throw new \RuntimeException( 'Filename may not contain ' . implode( count( $bad ) > 2 ? ', ' : ' ', $bad ) . '.' );
123
		}
124

projects/packages/changelogger/src/ValidateCommand.php 1 location

@@ 139-141 (lines=3) @@
136
					},
137
					array_keys( $types )
138
				);
139
				if ( count( $list ) > 1 ) {
140
					$list[ count( $list ) - 1 ] = 'or ' . $list[ count( $list ) - 1 ];
141
				}
142
				$messages[] = array( 'error', 'Type must be ' . implode( count( $list ) > 2 ? ', ' : ' ', $list ) . '.', $diagnostics['lines']['Type'] );
143
			}
144
		}