Skip to content

Commit

Permalink
Set public visibility on methods that container interface exposes
Browse files Browse the repository at this point in the history
  • Loading branch information
aedart committed Mar 22, 2024
1 parent 9629ae3 commit 424eac4
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions packages/container/src/Container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default class Container implements ServiceContainerContract
*
* @return {ServiceContainerContract|this}
*/
static getInstance(): ServiceContainerContract
public static getInstance(): ServiceContainerContract
{
if (this.#instance === null) {
this.setInstance(new this());
Expand All @@ -79,7 +79,7 @@ export default class Container implements ServiceContainerContract
*
* @return {ServiceContainerContract | null}
*/
static setInstance(container: ServiceContainerContract | null = null): ServiceContainerContract | null
public static setInstance(container: ServiceContainerContract | null = null): ServiceContainerContract | null
{
return this.#instance = container;
}
Expand All @@ -95,7 +95,7 @@ export default class Container implements ServiceContainerContract
*
* @throws {TypeError}
*/
bind(identifier: Identifier, concrete?: FactoryCallback | Constructor, shared: boolean = false): this
public bind(identifier: Identifier, concrete?: FactoryCallback | Constructor, shared: boolean = false): this
{
concrete = concrete ?? identifier as Constructor;

Expand All @@ -117,7 +117,7 @@ export default class Container implements ServiceContainerContract
*
* @throws {TypeError}
*/
bindIf(identifier: Identifier, concrete?: FactoryCallback | Constructor, shared: boolean = false): this
public bindIf(identifier: Identifier, concrete?: FactoryCallback | Constructor, shared: boolean = false): this
{
if (!this.bound(identifier)) {
this.bind(identifier, concrete, shared);
Expand All @@ -136,7 +136,7 @@ export default class Container implements ServiceContainerContract
*
* @throws {TypeError}
*/
singleton(identifier: Identifier, concrete?: FactoryCallback | Constructor): this
public singleton(identifier: Identifier, concrete?: FactoryCallback | Constructor): this
{
return this.bind(identifier, concrete, true);
}
Expand All @@ -151,7 +151,7 @@ export default class Container implements ServiceContainerContract
*
* @throws {TypeError}
*/
singletonIf(identifier: Identifier, concrete?: FactoryCallback | Constructor): this
public singletonIf(identifier: Identifier, concrete?: FactoryCallback | Constructor): this
{
if (!this.bound(identifier)) {
this.singleton(identifier, concrete);
Expand All @@ -172,7 +172,7 @@ export default class Container implements ServiceContainerContract
*
* @throws {TypeError}
*/
instance<T = object>(identifier: Identifier, instance: T): T
public instance<T = object>(identifier: Identifier, instance: T): T
{
this.instances.set(identifier, instance as object);

Expand All @@ -193,7 +193,7 @@ export default class Container implements ServiceContainerContract
* @throws {NotFoundException}
* @throws {ContainerException}
*/
get<
public get<
T = any /* eslint-disable-line @typescript-eslint/no-explicit-any */
>(identifier: Identifier): T

Check failure on line 198 in packages/container/src/Container.ts

View workflow job for this annotation

GitHub Actions / Ion (Node 20 on ubuntu-22.04)

'identifier' is defined but never used
{
Expand All @@ -208,7 +208,7 @@ export default class Container implements ServiceContainerContract
*
* @returns {boolean}
*/
has(identifier: Identifier): boolean
public has(identifier: Identifier): boolean
{
return this.bindings.has(identifier)
|| this.instances.has(identifier)
Expand All @@ -222,7 +222,7 @@ export default class Container implements ServiceContainerContract
*
* @returns {boolean}
*/
bound(identifier: Identifier): boolean
public bound(identifier: Identifier): boolean
{
return this.has(identifier);
}
Expand All @@ -237,7 +237,7 @@ export default class Container implements ServiceContainerContract
*
* @throws {TypeError}
*/
alias(identifier: Identifier, alias: Alias): this
public alias(identifier: Identifier, alias: Alias): this
{
if (alias === identifier) {
throw new TypeError(`${identifier.toString()} is aliased to itself`, { cause: { identifier: identifier, alias: alias } });
Expand All @@ -255,7 +255,7 @@ export default class Container implements ServiceContainerContract
*
* @return {boolean}
*/
isAlias(identifier: Identifier): boolean
public isAlias(identifier: Identifier): boolean
{
return this.aliases.has(identifier);
}
Expand All @@ -273,7 +273,7 @@ export default class Container implements ServiceContainerContract
* @throws {NotFoundException}
* @throws {ContainerException}
*/
make<
public make<
T = any /* eslint-disable-line @typescript-eslint/no-explicit-any */
>(identifier: Identifier, args?: any[] /* eslint-disable-line @typescript-eslint/no-explicit-any */): T

Check failure on line 278 in packages/container/src/Container.ts

View workflow job for this annotation

GitHub Actions / Ion (Node 20 on ubuntu-22.04)

'identifier' is defined but never used

Check failure on line 278 in packages/container/src/Container.ts

View workflow job for this annotation

GitHub Actions / Ion (Node 20 on ubuntu-22.04)

'args' is defined but never used
{
Expand All @@ -295,7 +295,7 @@ export default class Container implements ServiceContainerContract
*
* @throws {ContainerException}
*/
makeOrDefault<
public makeOrDefault<
T = any, /* eslint-disable-line @typescript-eslint/no-explicit-any */
D = undefined
>(identifier: Identifier, args?: any[] /* eslint-disable-line @typescript-eslint/no-explicit-any */, defaultValue?: D): T | D

Check failure on line 301 in packages/container/src/Container.ts

View workflow job for this annotation

GitHub Actions / Ion (Node 20 on ubuntu-22.04)

'identifier' is defined but never used

Check failure on line 301 in packages/container/src/Container.ts

View workflow job for this annotation

GitHub Actions / Ion (Node 20 on ubuntu-22.04)

'args' is defined but never used

Check failure on line 301 in packages/container/src/Container.ts

View workflow job for this annotation

GitHub Actions / Ion (Node 20 on ubuntu-22.04)

'defaultValue' is defined but never used
Expand All @@ -315,7 +315,7 @@ export default class Container implements ServiceContainerContract
*
* @throws {ContainerException}
*/
build<T = object>(concrete: Constructor<T> | Binding<T>): T
public build<T = object>(concrete: Constructor<T> | Binding<T>): T

Check failure on line 318 in packages/container/src/Container.ts

View workflow job for this annotation

GitHub Actions / Ion (Node 20 on ubuntu-22.04)

'concrete' is defined but never used
{
// TODO: Implement this...
return null as T;
Expand All @@ -331,7 +331,7 @@ export default class Container implements ServiceContainerContract
*
* @throws {ContainerException}
*/
call(method: Callback | CallbackWrapper | ClassMethodReference, args: any[]): any /* eslint-disable-line @typescript-eslint/no-explicit-any */
public call(method: Callback | CallbackWrapper | ClassMethodReference, args: any[]): any /* eslint-disable-line @typescript-eslint/no-explicit-any */

Check failure on line 334 in packages/container/src/Container.ts

View workflow job for this annotation

GitHub Actions / Ion (Node 20 on ubuntu-22.04)

'method' is defined but never used

Check failure on line 334 in packages/container/src/Container.ts

View workflow job for this annotation

GitHub Actions / Ion (Node 20 on ubuntu-22.04)

'args' is defined but never used
{
// TODO: Implement this...
return null;
Expand All @@ -348,7 +348,7 @@ export default class Container implements ServiceContainerContract
* @throws {TypeError}
* @throws {ContainerException}
*/
extend(identifier: Identifier, callback: ExtendCallback): this
public extend(identifier: Identifier, callback: ExtendCallback): this

Check failure on line 351 in packages/container/src/Container.ts

View workflow job for this annotation

GitHub Actions / Ion (Node 20 on ubuntu-22.04)

'identifier' is defined but never used
{
// TODO: Implement this...
return this;
Expand All @@ -361,7 +361,7 @@ export default class Container implements ServiceContainerContract
*
* @returns {boolean}
*/
forget(identifier: Identifier): boolean
public forget(identifier: Identifier): boolean
{
// TODO: Implement this...
return false;
Expand All @@ -372,7 +372,7 @@ export default class Container implements ServiceContainerContract
*
* @returns {void}
*/
flush(): void
public flush(): void
{
// TODO: Implement this...
return;
Expand All @@ -385,7 +385,7 @@ export default class Container implements ServiceContainerContract
*
* @return {boolean}
*/
isResolved(identifier: Identifier): boolean
public isResolved(identifier: Identifier): boolean
{
// TODO: Implement this...
return false;
Expand All @@ -399,7 +399,7 @@ export default class Container implements ServiceContainerContract
*
* @return {this}
*/
before(identifier: Identifier, callback: BeforeResolvedCallback): this
public before(identifier: Identifier, callback: BeforeResolvedCallback): this
{
// TODO: Implement this...
return this;
Expand All @@ -413,7 +413,7 @@ export default class Container implements ServiceContainerContract
*
* @return {this}
*/
after(identifier: Identifier, callback: AfterResolvedCallback): this
public after(identifier: Identifier, callback: AfterResolvedCallback): this
{
// TODO: Implement this...
return this;
Expand Down

0 comments on commit 424eac4

Please sign in to comment.