Skip to content

Commit

Permalink
fix analysis issues. no functional changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bradcypert committed Mar 10, 2023
1 parent 34107ea commit 1f1aba9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 27 deletions.
40 changes: 20 additions & 20 deletions lib/controllers/route_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,45 +76,45 @@ class Path {
}

/// Annotation for creating GET route bindings
final GetAnnotation = reflectClass(Get);
final getAnnotation = reflectClass(Get);

/// Annotation for creating PUT route bindings
final PutAnnotation = reflectClass(Put);
final putAnnotation = reflectClass(Put);

/// Annotation for creating POST route bindings
final PostAnnotation = reflectClass(Post);
final postAnnotation = reflectClass(Post);

/// Annotation for creating PATCH route bindings
final PatchAnnotation = reflectClass(Patch);
final patchAnnotation = reflectClass(Patch);

/// Annotation for creating DELETE route bindings
final DeleteAnnotation = reflectClass(Delete);
final deleteAnnotation = reflectClass(Delete);

/// Annotation for creating TRACE route bindings
final TraceAnnotation = reflectClass(Trace);
final traceAnnotation = reflectClass(Trace);

/// Annotation for creating HEAD route bindings
final HeadAnnotation = reflectClass(Head);
final headAnnotation = reflectClass(Head);

/// Annotation for creating OPTIONS route bindings
final OptionsAnnotation = reflectClass(Options);
final optionsAnnotation = reflectClass(Options);

/// Annotation for creating CONNECT route bindings
final ConnectAnnotation = reflectClass(Connect);
final connectAnnotation = reflectClass(Connect);

/// Annotation for creating a root path for a controller
final PathAnnotation = reflectClass(Path);
final pathAnnotation = reflectClass(Path);

final _allHttpVerbs = [
GetAnnotation,
PutAnnotation,
PostAnnotation,
PatchAnnotation,
DeleteAnnotation,
TraceAnnotation,
HeadAnnotation,
OptionsAnnotation,
ConnectAnnotation
getAnnotation,
putAnnotation,
postAnnotation,
patchAnnotation,
deleteAnnotation,
traceAnnotation,
headAnnotation,
optionsAnnotation,
connectAnnotation
];

class PathControllerReflectiveBinding extends RouteBindingDecorator {
Expand All @@ -131,7 +131,7 @@ List<PathControllerReflectiveBinding> getPaths(ClassMirror mirror) {

// If the class has a @Path specified, we'll set it as the base
mirror.metadata.forEach((metadata) {
if (metadata.type == PathAnnotation) {
if (metadata.type == pathAnnotation) {
basePath = metadata.reflectee as Path;
}
});
Expand Down
1 change: 0 additions & 1 deletion test/router/middleware_routing_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:convert';
import 'dart:io';

import 'package:steward/controllers/route_utils.dart';
Expand Down
12 changes: 6 additions & 6 deletions test/router/router_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class UserService {
class ComplexResponseBody {
String content = 'Hello';

toJson() => {'content': content};
Map<String, dynamic> toJson() => {'content': content};
}

@Path('/cont')
Expand Down Expand Up @@ -226,15 +226,15 @@ void main() {
final client = HttpClient();
final request =
await client.get(InternetAddress.loopbackIPv4.host, 4040, '/nice');
final response = await request.close();
await request.close();
expect(counter, equals(1));
final request2 =
await client.get(InternetAddress.loopbackIPv4.host, 4040, '/nice/');
final response2 = await request2.close();
await request2.close();
expect(counter, equals(2));
final request3 =
await client.get(InternetAddress.loopbackIPv4.host, 4040, '/nice/hat');
final response3 = await request3.close();
await request3.close();
expect(counter, equals(2));
});

Expand All @@ -248,11 +248,11 @@ void main() {
final client = HttpClient();
final request =
await client.get(InternetAddress.loopbackIPv4.host, 4040, '/nice');
final response = await request.close();
await request.close();
expect(counter, equals(1));
final request2 =
await client.get(InternetAddress.loopbackIPv4.host, 4040, '/NICE');
final response2 = await request2.close();
await request2.close();
expect(counter, equals(2));
});
}

0 comments on commit 1f1aba9

Please sign in to comment.